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 be...@belgacom.be on 2002/07/10 16:23:25 UTC

Problem for accepting SOAP messages without namespace (detailed)

Hi,

I am currently using Apache SOAP 2.2 and I must receive the following type of message (using messagerouter) :

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
	<SOAP-ENV:Body>
		<npbroadcast>
			<number xsi:type="xsd:integer">0496522323</number>			
		</npbroadcast>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The soap messagerouter complains about missing namespace. (I receive a java.lang.NullPointerException)

Can someone tell me how I can deploy npbroadcast service without having to specify a namespace attribute.

Everything is working fine when I deploy with a namespace and invoking the service with a message like:
...
	<SOAP-ENV:Body>
		<npbroadcast xmlns="MYNS">
			<number xsi:type="xsd:integer">0496522323</number>			
		</npbroadcast>
	</SOAP-ENV:Body>
...

Benoit Devos


**** DISCLAIMER **** 
"This e-mail and any attachments thereto may contain information 
which is confidential and/or protected by intellectual property 
rights and are intended for the sole use of the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, 
total or partial reproduction, communication or distribution in any form) 
by persons other than the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either 
by telephone or by e-mail and delete the material from any computer. 
Thank you for your cooperation."


RE: Problem for accepting SOAP messages without namespace (detailed)

Posted by Daniel P Allen <da...@nist.gov>.
	The messagerouter uses the namespace declaration to find your service.  See
the
	following exchange for a discussion of hacks to the messagerouter to
dispatch
	from other data (i.e. SOAPAction HTTP header)

	Dan

-Dan,
Yes; the following quick hack to the MessageRouterServlet.doPost() "works".
The deployment description for our "urn:txlife-processor" is found and my
provider is invoked.
Could this SOAPAction lookup make sense as a desired behavior for the stock
Message Router?

...
        String targetID = e.getNamespaceURI ();
        if (targetID == null) {
         // Check the SOAPAction for targetID (e.g.,
"urn:txlife-processor").
         targetID = req.getHeader("SOAPAction");
         targetID = targetID.substring(1, targetID.length()-1);
        }
        String messageName = e.getLocalName ();

        // is this a valid message?
        dd = serviceManager.query (targetID);





"Daniel P Allen" <da...@nist.gov> on 06/26/2002 08:23:59 AM

Please respond to soap-user@xml.apache.org

To:   <so...@xml.apache.org>, <we...@laconiadatasystems.com>
cc:   <JM...@genam.com>

Subject:  RE: Routing to Message Service



   The point is the Apache MessageRouter uses the first namespace
declaration in  the Body to find the service
  and Jim wants it to use SOAPAction  instead.  No can do with the stock
MessageRouter.  The code  for
  message router is not long and is simple to  understand,  A quick hack to
change where it looks is  almost
  trivial. A bit more difficult but still  relatively simple would be to
check SOAPAction against the  deployed
  services database and dispatch if a match  is found.  If no match then
proceed with the stock  behavior.
  This would eliminate the need for running  two different servlets if you
are servicing "standard"  Apache
  applications along with the ones Jim's  folks are deploying.  BTW - the
ebXML MessageService
   Specification also requires a different lookup mechanism.  They have
added  Service and Action
   elements to the header for this purpose but do not preclude use of
SOAPAction..

   Dan










-----Original Message-----
From: Martin Gainty  [mailto:mgainty@hotmail.com]
Sent: Tuesday, June 25, 2002 6:25  PM
To: soap-user@xml.apache.org
Cc:  JMaus@genam.com
Subject: Re: Routing to Message  Service



Jim:
Take a look at http://xml.apache.org/soap/docs/guide/rpcclient.html for
step by step building a RPC Client:

Specifically Step 4

   Set the target URI into the Call object using the  setTargetObjectURI
   (...)method.
   Pass in the URN that the service used  to identify itself in its
   deployment  descriptor.

   (For Deployment Descriptors) Check out
   http://xmlapache.org/soap/docs/guide/deploy.html

Standard Java Class Deployment Descriptor

A deployment descriptor which exposes a service which is implemented via a
standard Java class (including a normal Java Bean) looks like the
following:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:service-urn" [type="message"] [checkMustUnderstands
="true|false"]>
<isd:provider type="java"
scope="Request | Session | Application"
methods="exposed-methods">
<isd:java class="implementing-class" [static="true|false"]/>
</isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r>
</isd:service>

Where service-urn is the URN that you want to give  to a service,
exposed-methods is a space separated  list of methods which you wish to
expose, and  implementing-class is fully qualified class name (i.e.
packagename.classname) that provides the methods which are being  exposed

I didnt see anything about SOAPAction here...
Anyone  else??

Martin  Gainty
>
>
>I have written a Message Services to pass a "TXLife" XML  document called
"txlife-processor", deployed it, and have it working. But, the  team
writing
>the client would like to use the SOAPAction to specify my
"txlife-processor" messaging service (not xlmns="urn:txlife-processor").
>Is there a way to configure the SOAP Message Router to use the  SOAPAction
(and not require xmlns="urn:txlife-processor" attribute on my XML
document)
>to route the TXLife to my txlife-processor?
>If SOAPAction is not appropriate, is there an alternative to  requiring
xmlns="urn:txlife-processor" attribute on my TXLife element ?
>
>Following does not work:
>...
>SOAPAction: "urn:txlife-processor"
>
>>="http://www.w3.org/2001/XMLSchema">
>
>
>...
>
>Following does work:
>...
>SOAPAction: ""
>
>>="http://www.w3.org/2001/XMLSchema">
>
>
>...
>
>Thank you for your assistance.
>-JimM
>
>
>
>--
>To unsubscribe, e-mail:
>For additional commands, e-mail:


Chat with friends online, try MSN Messenger: Click Here
-- To  unsubscribe, e-mail: For  additional commands, e-mail:







--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>

> -----Original Message-----
> From: benoit.devos@belgacom.be [mailto:benoit.devos@belgacom.be]
> Sent: Wednesday, July 10, 2002 10:23 AM
> To: soap-user@xml.apache.org
> Subject: Problem for accepting SOAP messages without namespace
> (detailed)
>
>
>
> Hi,
>
> I am currently using Apache SOAP 2.2 and I must receive the
> following type of message (using messagerouter) :
>
> <SOAP-ENV:Envelope
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> 	<SOAP-ENV:Body>
> 		<npbroadcast>
> 			<number
> xsi:type="xsd:integer">0496522323</number>
> 		</npbroadcast>
> 	</SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> The soap messagerouter complains about missing namespace. (I
> receive a java.lang.NullPointerException)
>
> Can someone tell me how I can deploy npbroadcast service without
> having to specify a namespace attribute.
>
> Everything is working fine when I deploy with a namespace and
> invoking the service with a message like:
> ...
> 	<SOAP-ENV:Body>
> 		<npbroadcast xmlns="MYNS">
> 			<number
> xsi:type="xsd:integer">0496522323</number>
> 		</npbroadcast>
> 	</SOAP-ENV:Body>
> ...
>
> Benoit Devos
>
>
> **** DISCLAIMER ****
> "This e-mail and any attachments thereto may contain information
> which is confidential and/or protected by intellectual property
> rights and are intended for the sole use of the recipient(s) named above.
> Any use of the information contained herein (including, but not
> limited to,
> total or partial reproduction, communication or distribution in any form)
> by persons other than the designated recipient(s) is prohibited.
> If you have received this e-mail in error, please notify the
> sender either
> by telephone or by e-mail and delete the material from any computer.
> Thank you for your cooperation."
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


RE: Problem for accepting SOAP messages without namespace (detailed)

Posted by Daniel P Allen <da...@nist.gov>.
	The messagerouter uses the namespace declaration to find your service.  See
the
	following exchange for a discussion of hacks to the messagerouter to
dispatch
	from other data (i.e. SOAPAction HTTP header)

	Dan

-Dan,
Yes; the following quick hack to the MessageRouterServlet.doPost() "works".
The deployment description for our "urn:txlife-processor" is found and my
provider is invoked.
Could this SOAPAction lookup make sense as a desired behavior for the stock
Message Router?

...
        String targetID = e.getNamespaceURI ();
        if (targetID == null) {
         // Check the SOAPAction for targetID (e.g.,
"urn:txlife-processor").
         targetID = req.getHeader("SOAPAction");
         targetID = targetID.substring(1, targetID.length()-1);
        }
        String messageName = e.getLocalName ();

        // is this a valid message?
        dd = serviceManager.query (targetID);





"Daniel P Allen" <da...@nist.gov> on 06/26/2002 08:23:59 AM

Please respond to soap-user@xml.apache.org

To:   <so...@xml.apache.org>, <we...@laconiadatasystems.com>
cc:   <JM...@genam.com>

Subject:  RE: Routing to Message Service



   The point is the Apache MessageRouter uses the first namespace
declaration in  the Body to find the service
  and Jim wants it to use SOAPAction  instead.  No can do with the stock
MessageRouter.  The code  for
  message router is not long and is simple to  understand,  A quick hack to
change where it looks is  almost
  trivial. A bit more difficult but still  relatively simple would be to
check SOAPAction against the  deployed
  services database and dispatch if a match  is found.  If no match then
proceed with the stock  behavior.
  This would eliminate the need for running  two different servlets if you
are servicing "standard"  Apache
  applications along with the ones Jim's  folks are deploying.  BTW - the
ebXML MessageService
   Specification also requires a different lookup mechanism.  They have
added  Service and Action
   elements to the header for this purpose but do not preclude use of
SOAPAction..

   Dan










-----Original Message-----
From: Martin Gainty  [mailto:mgainty@hotmail.com]
Sent: Tuesday, June 25, 2002 6:25  PM
To: soap-user@xml.apache.org
Cc:  JMaus@genam.com
Subject: Re: Routing to Message  Service



Jim:
Take a look at http://xml.apache.org/soap/docs/guide/rpcclient.html for
step by step building a RPC Client:

Specifically Step 4

   Set the target URI into the Call object using the  setTargetObjectURI
   (...)method.
   Pass in the URN that the service used  to identify itself in its
   deployment  descriptor.

   (For Deployment Descriptors) Check out
   http://xmlapache.org/soap/docs/guide/deploy.html

Standard Java Class Deployment Descriptor

A deployment descriptor which exposes a service which is implemented via a
standard Java class (including a normal Java Bean) looks like the
following:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:service-urn" [type="message"] [checkMustUnderstands
="true|false"]>
<isd:provider type="java"
scope="Request | Session | Application"
methods="exposed-methods">
<isd:java class="implementing-class" [static="true|false"]/>
</isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r>
</isd:service>

Where service-urn is the URN that you want to give  to a service,
exposed-methods is a space separated  list of methods which you wish to
expose, and  implementing-class is fully qualified class name (i.e.
packagename.classname) that provides the methods which are being  exposed

I didnt see anything about SOAPAction here...
Anyone  else??

Martin  Gainty
>
>
>I have written a Message Services to pass a "TXLife" XML  document called
"txlife-processor", deployed it, and have it working. But, the  team
writing
>the client would like to use the SOAPAction to specify my
"txlife-processor" messaging service (not xlmns="urn:txlife-processor").
>Is there a way to configure the SOAP Message Router to use the  SOAPAction
(and not require xmlns="urn:txlife-processor" attribute on my XML
document)
>to route the TXLife to my txlife-processor?
>If SOAPAction is not appropriate, is there an alternative to  requiring
xmlns="urn:txlife-processor" attribute on my TXLife element ?
>
>Following does not work:
>...
>SOAPAction: "urn:txlife-processor"
>
>>="http://www.w3.org/2001/XMLSchema">
>
>
>...
>
>Following does work:
>...
>SOAPAction: ""
>
>>="http://www.w3.org/2001/XMLSchema">
>
>
>...
>
>Thank you for your assistance.
>-JimM
>
>
>
>--
>To unsubscribe, e-mail:
>For additional commands, e-mail:


Chat with friends online, try MSN Messenger: Click Here
-- To  unsubscribe, e-mail: For  additional commands, e-mail:







--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>

> -----Original Message-----
> From: benoit.devos@belgacom.be [mailto:benoit.devos@belgacom.be]
> Sent: Wednesday, July 10, 2002 10:23 AM
> To: soap-user@xml.apache.org
> Subject: Problem for accepting SOAP messages without namespace
> (detailed)
>
>
>
> Hi,
>
> I am currently using Apache SOAP 2.2 and I must receive the
> following type of message (using messagerouter) :
>
> <SOAP-ENV:Envelope
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> 	<SOAP-ENV:Body>
> 		<npbroadcast>
> 			<number
> xsi:type="xsd:integer">0496522323</number>
> 		</npbroadcast>
> 	</SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> The soap messagerouter complains about missing namespace. (I
> receive a java.lang.NullPointerException)
>
> Can someone tell me how I can deploy npbroadcast service without
> having to specify a namespace attribute.
>
> Everything is working fine when I deploy with a namespace and
> invoking the service with a message like:
> ...
> 	<SOAP-ENV:Body>
> 		<npbroadcast xmlns="MYNS">
> 			<number
> xsi:type="xsd:integer">0496522323</number>
> 		</npbroadcast>
> 	</SOAP-ENV:Body>
> ...
>
> Benoit Devos
>
>
> **** DISCLAIMER ****
> "This e-mail and any attachments thereto may contain information
> which is confidential and/or protected by intellectual property
> rights and are intended for the sole use of the recipient(s) named above.
> Any use of the information contained herein (including, but not
> limited to,
> total or partial reproduction, communication or distribution in any form)
> by persons other than the designated recipient(s) is prohibited.
> If you have received this e-mail in error, please notify the
> sender either
> by telephone or by e-mail and delete the material from any computer.
> Thank you for your cooperation."
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>