You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Franck Mangin <FM...@facetime.com> on 2001/04/22 18:10:56 UTC

HowTo: MS SOAP client to Apache SOAP service

  After a lot of experimentation I finally was able to have an MS SOAP
SDK 2.0 client talk to an Apache soap 2.1 service, RPC style. Since this
doesn't seem to be addressed in the toolkit documentation, I wrote a
small guide to describe what is needed - feel free to edit & reuse as
needed...
 
  Franck Mangin
 
===================================================
MS SOAP clients won't talk to Apache SOAP RPC service out of the box
using the "high-level" MS api unless you take a couple specific steps.
Let's assume that your service "MyService" has a single bean with the
following method:
 
  public String[] getEntry(String lookupKey) { ... }
 
To get started, create a VB ActiveX dll project with a single method:
public Function getEntry(lookupKey as String) as String()
 
Compile the dll and run wsdlgen.exe from the MS soap sdk. Once you have
the wsdl file, open it in a text editor and fix the following things:
  1. Set action attributes to the empty string (not sure if this is
absolutely required)
  2. In each <input> & <output> element, change the namespace attribute
of the soap:body element from http://tempuri.org/... to "urn:MyService"
  3. Make sure the message elements for the getEntryResponse has only
one part element (for the returned array of strings) - for some reason
the generator added a part for the calling parameter in my case - apache
doesn't return the calling parameter in the response.
 
Now what happens is that the MS sdk will send requests where parameter
types are not specified, e.g.
<lookupKey>foo</lookupKey> when Apache is expecting something like
<xsd:type name=string>foo</xsd:type>
  You'll have to address this be registering a deserializer for each
parameter *name* (not type) declared in your wsdl file. Here's what you
need to add to your deployment descriptor for our example:
 
<isd:mappings>
      <isd:map encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:x="" qname="x:lookupKey"
 
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/
>      
  </isd:mappings>
 
Your MS soap client should now be able to talk to the service using the
wsdl file & the high level API.
 
  
 

null pointers

Posted by David Wall <dw...@Yozons.com>.
I'm trying to return a fairly complex object, but I get a null pointer
exception.  From the response trace, I cannot tell if this is something I've
done, or a bug, but generally they are things I've done!  Anyway, will the
BeanSerializer correctly handle fields that are null?  These could be simple
String fields, or they could a LinkedList that hasn't been set, or a handle
to another optional object.

Thanks,
David

<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<faultactor>/soap/servlet/rpcrouter</faultactor>
<detail>
<stackTrace>[SOAPException: faultCode=SOAP-ENV:Server;
msg=java.lang.NullPointerException]
 at
org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:132)
 at
org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:26
7)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
 at org.apache.tomcat.core.Handler.service(Handler.java:287)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection
(Ajp13ConnectionHandler.java:160)
 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)
</stackTrace>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


null pointers

Posted by David Wall <dw...@Yozons.com>.
I'm trying to return a fairly complex object, but I get a null pointer
exception.  From the response trace, I cannot tell if this is something I've
done, or a bug, but generally they are things I've done!  Anyway, will the
BeanSerializer correctly handle fields that are null?  These could be simple
String fields, or they could a LinkedList that hasn't been set, or a handle
to another optional object.

Thanks,
David

<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<faultactor>/soap/servlet/rpcrouter</faultactor>
<detail>
<stackTrace>[SOAPException: faultCode=SOAP-ENV:Server;
msg=java.lang.NullPointerException]
 at
org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:132)
 at
org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:26
7)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
 at org.apache.tomcat.core.Handler.service(Handler.java:287)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection
(Ajp13ConnectionHandler.java:160)
 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)
</stackTrace>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: HowTo: MS SOAP client to Apache SOAP service

Posted by David Schloss <ds...@desres.com>.
To eliminate the generator adding a parameter in the response, declare
it as BYVAL (sort of equivalent to [in] in IDL), e.g. in the VB stub
   public Function getEntry(ByVal lookupKey as String) as String()

David

Franck Mangin wrote:
> 
>   After a lot of experimentation I finally was able to have an MS SOAP
> SDK 2.0 client talk to an Apache soap 2.1 service, RPC style. 
> ...
> To get started, create a VB ActiveX dll project with a single method:
> public Function getEntry(lookupKey as String) as String()
> ...
>   3. Make sure the message elements for the getEntryResponse has only
> one part element (for the returned array of strings) - for some reason
> the generator added a part for the calling parameter in my case - apache
> doesn't return the calling parameter in the response.

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: HowTo: MS SOAP client to Apache SOAP service

Posted by David Schloss <ds...@desres.com>.
To eliminate the generator adding a parameter in the response, declare
it as BYVAL (sort of equivalent to [in] in IDL), e.g. in the VB stub
   public Function getEntry(ByVal lookupKey as String) as String()

David

Franck Mangin wrote:
> 
>   After a lot of experimentation I finally was able to have an MS SOAP
> SDK 2.0 client talk to an Apache soap 2.1 service, RPC style. 
> ...
> To get started, create a VB ActiveX dll project with a single method:
> public Function getEntry(lookupKey as String) as String()
> ...
>   3. Make sure the message elements for the getEntryResponse has only
> one part element (for the returned array of strings) - for some reason
> the generator added a part for the calling parameter in my case - apache
> doesn't return the calling parameter in the response.

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org