axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avei...@allesta.com
Subject Re: Issue with JAX-RPC Client: ServiceLocator vs. ServiceFactory
Date Fri, 06 Aug 2004 23:22:11 GMT
Doing a bit more digging it looks like the request envelope that is created when
using the ServiceFactory scheme is not well formed.

ENVELOPE GENERATED USING ServiceFactory scheme
-----------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <sendSms xmlns="http://service.v1_0.send.sms.parlayx.wsdl.www.csapi.org">
   <>sendSms>in0 xsi:type="ns1:ArrayOfEndUserIdentifier"
xmlns:ns1="http://www.csapi.org/schema/parlayx/common/v1_0">
    <ArrayOfEndUserIdentifier xsi:type="ns1:EndUserIdentifier" xmlns="">
     <value>tel:9135277984</value>
    </ArrayOfEndUserIdentifier>
   </>sendSms>in0>
   <>sendSms>in1>blah</>sendSms>in1>
   <>sendSms>in2>blah</>sendSms>in2>
   <>sendSms>in3>Call Me!</>sendSms>in3>
  </sendSms>
 </soapenv:Body>
</soapenv:Envelope>


ENVELOPE GENERATED USING ServiceLocator scheme
-----------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <sendSms xmlns="http://www.csapi.org/schema/parlayx/sms/send/v1_0/local">
   <destAddressSet>
    <ArrayOfEndUserIdentifier xmlns="">
     <value>tel:9135277984</value>
    </ArrayOfEndUserIdentifier>
   </destAddressSet>
   <senderName>blah</senderName>
   <charging>blah</charging>
   <message>Call Me!</message>
  </sendSms>
 </soapenv:Body>
</soapenv:Envelope>



Quoting aveitas@allesta.com:

> Hello,
>
> Wanted to present something that we have run into on the client side, not
> sure
> if we are doing something wrong or if it is something else.  The web service
> is
> based on the parlay x specification.
>
> The client code is calling a web service and is retrieving a stub to the
> service
> 2 ways, via the ServiceLocator and via the ServiceFactory. When we retrieve
> the
> stub from the ServiceFactory it gags, but when we are using the
> ServiceLocator
> it works like a charm.  Here are some code snippets:
>
> THIS CODE WORKS (call to invoke successful):
> ----------------------------------------------
> SendSmsServiceLocator locator = new SendSmsServiceLocator();
> SendSms smsSendService = locator.getSendSms(new
> URL("http://localhost:8080/axis/services/SendSms"));
> invoke(smsSendService);
>
> THIS CODE CHOKES (call to invoke throws Exception):
> ---------------------------------------------------
> URL urlWsdl         = new
> URL("http://localhost:8080/axis/services/SendSms?wsdl");
> String nameSpaceUri =
> "http://www.csapi.org/wsdl/parlayx/sms/send/v1_0/service";
> String serviceName  = "SendSmsService";
> String portName     = "SendSms";
>
> ServiceFactory serviceFactory = ServiceFactory.newInstance();
> Service service = serviceFactory.createService(urlWsdl, new
> QName(nameSpaceUri,
> serviceName));
> SendSms myProxy = (SendSms) service.getPort(new QName(nameSpaceUri,
> portName),
> SendSms.class);
> invoke(myProxy);
>
> We get the following stack trace when it gags.
>
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: org.xml.sax.SAXParseException: The content of elements must
> consist of well-formed character data or markup.
>  faultActor:
>  faultNode:
>  faultDetail:
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: The
> content of elements must consist of well-formed character data or markup.
> 	at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
> 	at
>
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
> 	at
>
org.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentScanner.java:624)
> 	at
>
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1194)
> 	at
>
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
> 	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at
>
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:218)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:568)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:427)
> 	at org.apache.axis.Message.getContentType(Message.java:484)
> 	at
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:307)
> 	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:87)
> 	at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> 	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> 	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:144)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2688)
> 	at org.apache.axis.client.Call.invoke(Call.java:2671)
> 	at org.apache.axis.client.Call.invoke(Call.java:2357)
> 	at org.apache.axis.client.Call.invoke(Call.java:2280)
> 	at org.apache.axis.client.Call.invoke(Call.java:1741)
> 	at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:156)
> 	at $Proxy0.sendSms(Unknown Source)
> at SmsSendTestDriver.invoke(SmsSendTestDriver.java:74)
> at SmsSendTestDriver.testJAXRPC(SmsSendTestDriver.java:63)
> at SmsSendTestDriver.main(SmsSendTestDriver.java:32)
>
>
> Are we doing something incorrect on our end??  Attached is the deploy.wsdd
> for
> the service which was genereated via wsdl2java.
>
> Searched in the user groups and the only thing that was related was the
> following
>
> http://marc.theaimsgroup.com/?l=axis-user&m=108368326110876&w=2
>
> Thanks,
>   Al
>
>
>
>



Mime
View raw message