- This topic has 3 replies, 3 voices, and was last updated 17 years, 7 months ago by imurillo.
-
AuthorPosts
-
imurilloMemberFirst I’d like to apologize if I’m posting to the wrong forum, but here it goes.
I’m trying to connect an XFIRE client to an MS IIS SOAP server WSDL service. After generating the JAVA classes for this server using the WSDL to JAVA wizard I attempt to get a service using the following code:
public class TestGeoServicios {
public static void main(String[] args) {
//create model from interface
Service srvcModel = newObjectServiceFactory().create(https.www_geoservicios_com.v2.ServicioAutenticacionSoap.class);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
//call the service
String xURL = “https://www.geoservicios.com/v2.0/sath/Sath.asmx/ObtenerTestigoPredeterminado/”;
try {
//caste the class
ServicioAutenticacionSoap srvc = (ServicioAutenticacionSoap)factory.create(srvcModel, xURL);// EtiquetaServicio : object which the service returns
EtiquetaServicio res = srvc.obtenerTestigoPredeterminado(“account”, “user”,”role”);
etc…The code returns the following error:
Exception in thread “main” org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Unexpected character ‘1’ (code 49) in start tag Expected a quote
at [row,col {unknown-source}]: [20,76]
org.codehaus.xfire.fault.XFireFault: Unexpected character ‘1’ (code 49) in start tag Expected a quote
at [row,col {unknown-source}]: [20,76]
at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at org.codehaus.xfire.client.Client.onReceive(Client.java:386)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy9.obtenerTestigoPredeterminado(Unknown Source)
at com.genuitec.myeclipse.wsexample.TestGeoServicios.main(TestGeoServicios.java:32)
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ‘1’ (code 49) in start tag Expected a quote
at [row,col {unknown-source}]: [20,76]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:600)
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2890)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2815)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2737)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1004)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:44)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
… 10 moreNote: when using the Web Service Explorer I have no problem getting a correct response from the server.
Would anyone be so kind as to explain whether or not this error has it’s origins in the server or on the client and what could be a possible fix for this problem?
Thanks in advance…
Iggy
Riyad KallaMemberMoving to OT > Soft Dev
Iggy, I’ll ping someone at XFire to see if they have any ideas.
tomekszMemberHi
First of all you can’t use ObjectServiceFactory on generated code. If you look at folder you generated classes to, you will see class with Client suffix ( like MyServiceClient ), you should use this client to connect to server.
Exception you showed means that server returned some http error, you can check xfire client log for details or use Tcpmon to intercept this message and see what went wrong.
imurilloMemberThanks for the help. tomekz, you were right and everything works just fine.
As Einstein said SIMPLICITY is the key.Thanks again!
-
AuthorPosts