Return-Path: Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 26994 invoked by uid 500); 23 Jul 2003 23:25:50 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 26982 invoked from network); 23 Jul 2003 23:25:49 -0000 Reply-To: From: "Chris Means" To: , Subject: RE: Problems with SOAP Header and .NET service Date: Wed, 23 Jul 2003 18:25:54 -0500 Message-ID: <14112795.1059003051568.JavaMail.Administrator@mail> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <373324.1058975830230.JavaMail.Administrator@mail> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-MessageIsSpam: No X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Dims, The setHeader method of the Stub does appear to work properly, despite my earlier problems. I had made a number of revisions to the WSDL2Java generated code during previous attempts to get headers working as I expected...these revisions had actually inhibited the correct functionality. (I'd been removing the XMLType settings in order to match the doc/lit requirements.) :< Now that I've put everything back the way it was, this code appears to be working correctly, that is, it's now being accepted by the M$ MapPoint.NET server despite the SOAP content being a bit more verbose than it apparently needs to be. Here's the functioning code snippet: if (getHeaders().length == 0) { CustomerInfoRouteHeader customerInfo = new CustomerInfoRouteHeader () ; customerInfo.setCustomLogEntry ((short) 10) ; setHeader (CustomerInfoRouteHeader.getTypeDesc().getXmlType().getNamespaceURI(), CustomerInfoRouteHeader.getTypeDesc().getXmlType().getLocalPart(), customerInfo) ; CultureInfo cultureInfo = new CultureInfo () ; cultureInfo.setName ("sv") ; UserInfoRouteHeader userInfo = new UserInfoRouteHeader () ; userInfo.setCulture (cultureInfo) ; userInfo.setDefaultDistanceUnit (DistanceUnit.Mile) ; setHeader (UserInfoRouteHeader.getTypeDesc().getXmlType().getNamespaceURI(), UserInfoRouteHeader.getTypeDesc().getXmlType().getLocalPart(), userInfo) ; } This is called from inside the Stub prior to the setRequestHeaders(_call); statement. Here's the SOAP output: 10 sv 0 Mile Lots more verbose than it needs to be, but I can live with it for now. I'll need to do a little work to allow the Stub to accept header objects as properties (or create new methods that take the header objects as parameters), but otherwise, I'm good to go. So, no bugs to report...though I'm wondering if the next rev. of WSDL2Java will incorporate the support of headers directly & automatically. Question: The Call object appears to keep prior set headers. Will they automatically use new property settings in the setHeader object (userInfo) or do/should I need to rebuild the header each time the underlying header object changes? Thanks for your help. -Chris > -----Original Message----- > From: Davanum Srinivas [mailto:dims@yahoo.com] > Sent: Wednesday, July 23, 2003 10:20 AM > To: axis-user@ws.apache.org; cmeans@empower.com > Subject: RE: Problems with SOAP Header and .NET service > > > Last resort - Try public SOAPHeaderElement(org.w3c.dom.Element > elem) constructor. You need to > create the dom element by hand. > > This is a bug that needs to be fixed. Would appreciate if you > could log it as one. > > Thanks, > dims > > --- Chris Means wrote: > > Thanks, but that didn't help: > > > > org.apache.axis.message.SOAPHeaderElement unknownHeader = > > new > > > org.apache.axis.message.SOAPHeaderElement("http://s.mappoint.net/m > appoint-30 > > /", > > "UserInfoRouteHeader", > > userInfo); > > unknownHeader.setMustUnderstand(true); > > _call.addHeader(unknownHeader); > > > > I get the same output: > > > > > > > xsi:type="ns1:UserInfoRouteHeader" > > xmlns:ns1="http://s.mappoint.net/mappoint-30/"> > > Mile > > > > > > > > Any other suggestions? > > > > I appreciate the help! > > > > -Chris > > > > > -----Original Message----- > > > From: Davanum Srinivas [mailto:dims@yahoo.com] > > > Sent: Wednesday, July 23, 2003 8:43 AM > > > To: cmeans@empower.com; axis-user@ws.apache.org > > > Subject: RE: Problems with SOAP Header and .NET service > > > > > > > > > Try the following to add headers... > > > SOAPHeaderElement unknownHeader = > > > new SOAPHeaderElement("http://example.org", > > > "unknown", > > > "Nobody understands me!"); > > > unknownHeader.setMustUnderstand(true); > > > _call.addHeader(unknownHeader); > > > > > > -- dims > > > > > > Excerpt from: > > > http://cvs.apache.org/viewcvs/xml-axis/java/test/wsdl/soap12/addit > > ional/WhiteMesaSoap12AddTestSvcTestCase.java > > > > > > --- Chris Means wrote: > > > > Yes. > > > > > > > > None of the Java/Axis projects appear to use SOAP Headers. > > > > > > > > Here's a snippet from one of the source files: > > > > > > > > // Call the MapPoint .NET server to calculate the route. > > > > // Unfortunately, Axis doesn't let us pass a > UserInfoRouteHeader > > > > // to the route service, so we cannot specify the > > > distance units to > > > > // use for the route. Instead, we use the default > > > (kilometers) and > > > > // convert to the desired units in the > DrivingDirectionsWindow. > > > > > > > > Are you aware of one that does? Or is there something I missed? > > > > > > > > > -----Original Message----- > > > > > From: Davanum Srinivas [mailto:dims@yahoo.com] > > > > > Sent: Wednesday, July 23, 2003 5:54 AM > > > > > To: axis-user@ws.apache.org; cmeans@empower.com > > > > > Subject: Re: Problems with SOAP Header and .NET service > > > > > > > > > > > > > > > Did you see the code posted by these guys? > http://demo.mappoint.net/ > > > > > > > > > > -- dims > > > > > > > > > > --- Chris Means wrote: > > > > > > Hi, > > > > > > > > > > > > I've been bashing my head against the wall trying to figure > > > > > this out...it's > > > > > > not as helpful as reading the documentation, but it hurts just > > > > > as much . > > > > > > > > > > > > I'm successfully using an Axis 1.1 client to talk to a .NET > > > > > service. The > > > > > > WSDL2Java tool worked well for the most part, but there > > > were one or two > > > > > > tweaks I had to make as Axis doesn't yet appear to support the > > > > > type > > > > > > that M$ loves so much. > > > > > > > > > > > > My remaining stumbling block appears to be with sending the > > > > > SOAP Headers the > > > > > > way .NET wants to get them. (The SOAP Body is perfect.) > > > > > > > > > > > > I've successfully been using the setHeader method of the > > > Stub to add new > > > > > > headers, however, Axis keeps adding xsi:type attributes, > > > > > despite the fact > > > > > > that I've got: > > > > > > > > > > > > > > > _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, > > > > > > Boolean.FALSE); > > > > > > > > > > > > (Does this setting not apply to headers added via the Stub? > > > I did try > > > > > > adding a header via _call.addHeader, but that didn't seem to do > > > > > the trick > > > > > > either.) > > > > > > > > > > > > So, instead of getting: > > > > > > > > > > > > > > > > > > xmlns="http://s.mappoint.net/mappoint-30/"> > > > > > > Mile > > > > > > > > > > > > > > > > > > > > > > > > I get: > > > > > > > > > > > > > > > > > > > > > > > xsi:type="ns1:UserInfoRouteHeader" > > > > > > xmlns:ns1="http://s.mappoint.net/mappoint-30/"> > > > > > > Mile > > > > > > > > > > > > > > > > > > > > > > > > Here's how I'm adding the header: > > > > > > > > > > > > UserInfoRouteHeader userInfo = new > > > UserInfoRouteHeader () ; > > > > > > userInfo.setDefaultDistanceUnit (DistanceUnit.Mile) ; > > > > > > > > > > > > setHeader ("http://s.mappoint.net/mappoint-30/", > > > > > > "UserInfoRouteHeader", > > > > > > userInfo) ; > > > > > > > > > > > > Can anyone point me in the right direction? > > > > > > > > > > > > Thanks. > > > > > > > > > > > > -Chris > > > > > > > > > > > > > > > > > > > > > > > > > > > ===== > > > > > Davanum Srinivas - http://webservices.apache.org/~dims/ > > > > > > > > > > __________________________________ > > > > > Do you Yahoo!? > > > > > Yahoo! SiteBuilder - Free, easy-to-use web site design software > > > > > http://sitebuilder.yahoo.com > > > > > > > > > > > > > > > > > > > > > > ===== > > > Davanum Srinivas - http://webservices.apache.org/~dims/ > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! SiteBuilder - Free, easy-to-use web site design software > > > http://sitebuilder.yahoo.com > > > > > > > > > > > > ===== > Davanum Srinivas - http://webservices.apache.org/~dims/ > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com >