Skip to content
This repository

Multiref href resolution for SOAP #160

Open
greenrd opened this Issue May 28, 2012 · 5 comments

2 participants

Robin Green eugene yokota
Robin Green
greenrd commented May 28, 2012

Currently, if a SOAP web service returns XML that uses multirefs, scalaxb generates this type of class:

case class ArrayOf_tns1_RemoteIssue(arg1: Option[com.ocado.jira.api.ArraySequence] = None,
  soapencarrayType: Option[String] = None,
  soapencoffset: Option[String] = None,
  id: Option[String] = None,
  href: Option[java.net.URI] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends Arrayable

(This was generated for the JIRA SOAP service.)

The arg1 field just references an array of scala.xml.Nodes, with href attributes, which doesn't really help me to find the referenced data, let alone bind it. The URI in each of those href attributes is just a local anchor like #id16. Also, the hrefs are a serialisation detail, which should not really be exposed (indeed, these should be bound instances, not scala.xml.Nodes).

So I would like a way to find the data referenced by the inner hrefs. Or am I missing something obvious?

eugene yokota
Owner

Currently scalaxb does not support references in SOAP. It's treating the messages as literal document.
I guess the best thing I could do is to resolve the references and stuff it into the case class?

Robin Green
greenrd commented May 29, 2012

Yes, that would be good.

eugene yokota
Owner

So I implemented href resolution at the XML level, so at least you'd have access to the data.
This is available in 0.7.2-SNAPSHOT. I'd appreciate if you could test it. Here's a sample project I created for JIRA service.

Once the hrefs are resolved I don't think there's much use for the SOAP encoding, so likely better data binding is possible, for example as DataRecord[RemoteIssue] etc. but that'll be more complicated change requiring special handling for SOAP encoded types, so it will be on nice to have list for the future.

Robin Green

I was unable to test it due to this error:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalaxb#sbt-scalaxb;0.7.2-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          org.scalaxb:sbt-scalaxb:0.7.2-SNAPSHOT (sbtVersion=0.11.3, scalaVersion=2.9.1)
[warn] 
[error] {file:/home/robin/workspace2/jira-worklog/project/}default-3f61c9/*:update: sbt.ResolveException: unresolved dependency: org.scalaxb#sbt-scalaxb;0.7.2-SNAPSHOT: not found

What do I need to do to fix this?

eugene yokota
Owner

Do you have the following resolvers?

resolvers ++= Seq(
  "sonatype-public" at "https://oss.sonatype.org/content/groups/public",
  "repo.codahale.com" at "http://repo.codahale.com")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.