Chris,

Please post a bug with your WSDL and the soap trace mentioning that it should not be 
so verbose...

Thanks,
dims

--- Chris Means <[EMAIL PROTECTED]> wrote:
> 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:
> 
>  <soapenv:Header>
>   <ns1:CustomerInfoRouteHeader soapenv:mustUnderstand="0"
> xsi:type="ns1:CustomerInfoRouteHeader"
> xmlns:ns1="http://s.mappoint.net/mappoint-30/";>
>    <ns1:CustomLogEntry>10</ns1:CustomLogEntry>
>   </ns1:CustomerInfoRouteHeader>
>   <ns2:UserInfoRouteHeader soapenv:mustUnderstand="0"
> xsi:type="ns2:UserInfoRouteHeader"
> xmlns:ns2="http://s.mappoint.net/mappoint-30/";>
>    <ns2:Culture xsi:type="ns2:CultureInfo">
>     <ns2:Name>sv</ns2:Name>
>     <ns2:Lcid>0</ns2:Lcid>
>    </ns2:Culture>
>    <ns2:DefaultDistanceUnit>Mile</ns2:DefaultDistanceUnit>
>   </ns2:UserInfoRouteHeader>
>  </soapenv:Header>
> 
> 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:[EMAIL PROTECTED]
> > Sent: Wednesday, July 23, 2003 10:20 AM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > 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 <[EMAIL PROTECTED]> 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:
> > >
> > >  <soapenv:Header>
> > >   <ns1:UserInfoRouteHeader soapenv:mustUnderstand="1"
> > > xsi:type="ns1:UserInfoRouteHeader"
> > > xmlns:ns1="http://s.mappoint.net/mappoint-30/";>
> > >    <DefaultDistanceUnit>Mile</DefaultDistanceUnit>
> > >   </ns1:UserInfoRouteHeader>
> > >  </soapenv:Header>
> > >
> > > Any other suggestions?
> > >
> > > I appreciate the help!
> > >
> > > -Chris
> > >
> > > > -----Original Message-----
> > > > From: Davanum Srinivas [mailto:[EMAIL PROTECTED]
> > > > Sent: Wednesday, July 23, 2003 8:43 AM
> > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > > 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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
> > > > > > Sent: Wednesday, July 23, 2003 5:54 AM
> > > > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > > > > 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 <[EMAIL PROTECTED]> 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 <g>.
> > > > > > >
> > > > > > > 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
> > > > > > <list> type
> > > > > > > that M$ loves so much.
> > > > > > >
> 
=== message truncated ===


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to