You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bjørn T Johansen <bt...@havleik.no> on 2008/10/22 09:08:03 UTC

Problem adding SOAP Headers and .Net?

I am trying to develop some web services using Java and CXF and the  
clients that are going to use these are written in .Net.
But I am having a problem... When I add SOAP headers like this..:

LogonServiceResponse logon(@WebParam(name = "userId") String userId,  
@WebParam(name = "password") String password, @WebParam(name =  
"soap_username", header = true, mode = WebParam.Mode.IN) String  
soap_username, @WebParam(name = "soap_password", header = true, mode =  
WebParam.Mode.IN) String soap_password);


(i.e the two last arguments), I get the following error from Visual  
Studio when trying to add the web reference..:

Custom tool error: Unable to import WebService/Schema. Unable to  
import binding 'serviceSoapBinding' from namespace  
'http://webservices.domainservice.as.asp.no/'. Unable to import  
operation 'logonService'. Part 'soap_username' from message  
'logonService' in namespace  
'http://webservices.domainservice.as.asp.no/' is missing the element  
attribute. The element attribute is required for headers when  
Use=Literal.


Can someone help me, this is my first try to make web services....



Regards,

BTJ


-- 
-----------------------------------------------------------------------------------------------
Bjørn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange  
Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


Re: Problem adding SOAP Headers and .Net?

Posted by Bjørn T Johansen <bt...@havleik.no>.
I managed to make it work but I am not sure why (but I havent't checked that hard yet).. I did some clean up in our
dependencies but I also reduced the number of soap header argument in my method from 2 to 1; and I think that was the
reason it didn't work but as I said, I haven't had time to check it yet...

BTJ

On Thu, 23 Oct 2008 21:41:16 -0500
"Michael Lewis" <mi...@mlcsoftware.com> wrote:

> I'm somewhat new to CXF myself, although I did some reading and the only
> thing that I can come up with is to add the following annotation to you
> ServiceEndpoint Interface under your @Webservice annotation.
> 
> @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
> use=SOAPBinding.Use.LITERAL, parameterStyle =
> SOAPBinding.ParameterStyle.WRAPPED)
> 
> I write webservices that are consumed by .net and I updated one of my
> parameters to use header = true, mode =
> WebParam.Mode.IN<http://webparam.mode.in/>,
> then imported the web service without problem in  VS 2005.
> 
> The actual annotation that I used in my project was:  @SOAPBinding(style =
> SOAPBinding.Style.RPC, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED),
> but I read that you need to have DOC/Literal to use the soap header.
> 
> Hope it helps.
> 
> ML
> 
> On Thu, Oct 23, 2008 at 2:24 AM, Bjørn T Johansen <bt...@havleik.no> wrote:
> 
> > On Wed, 22 Oct 2008 13:42:01 -0400
> > Daniel Kulp <dk...@apache.org> wrote:
> >
> > >
> > > Quick questions:
> > >
> > > 1) What version of CXF?
> >
> > Was using 2.1.2 and now I tried with 2.1.3 with the same result..
> >
> > >
> > > 2) What version of the XmlSchema jar?
> >
> > 1.4.2
> >
> > >
> > > 3) Can you include the wsdl generated from that interface as well?
> >
> > Attached...
> >
> > >
> > > Jarek found a very similar error while integrating CXF 2.1.x into
> > Geronimo.
> > > It turned out it was due to picking up XmlSchema 1.3.3 instead of 1.4.2.
> > > Once he managed to get maven to pick up the 1.4.2 version, it all worked
> > > fine.
> > >
> > > Dan
> > >
> > >
> > > On Wednesday 22 October 2008 3:08:03 am Bjørn T Johansen wrote:
> > > > I am trying to develop some web services using Java and CXF and the
> > > > clients that are going to use these are written in .Net.
> > > > But I am having a problem... When I add SOAP headers like this..:
> > > >
> > > > LogonServiceResponse logon(@WebParam(name = "userId") String userId,
> > > > @WebParam(name = "password") String password, @WebParam(name =
> > > > "soap_username", header = true, mode = WebParam.Mode.IN) String
> > > > soap_username, @WebParam(name = "soap_password", header = true, mode =
> > > > WebParam.Mode.IN) String soap_password);
> > > >
> > > >
> > > > (i.e the two last arguments), I get the following error from Visual
> > > > Studio when trying to add the web reference..:
> > > >
> > > > Custom tool error: Unable to import WebService/Schema. Unable to
> > > > import binding 'serviceSoapBinding' from namespace
> > > > 'http://webservices.domainservice.as.asp.no/'. Unable to import
> > > > operation 'logonService'. Part 'soap_username' from message
> > > > 'logonService' in namespace
> > > > 'http://webservices.domainservice.as.asp.no/' is missing the element
> > > > attribute. The element attribute is required for headers when
> > > > Use=Literal.
> > > >
> > > >
> > > > Can someone help me, this is my first try to make web services....
> > > >
> > > >
> > > >
> > > > Regards,
> > > >
> > > > BTJ
> > >
> > >
> > >

Re: Problem adding SOAP Headers and .Net?

Posted by Michael Lewis <mi...@mlcsoftware.com>.
Also, I checked and I used XmlSchema 1.3.2.  I deployed my webservices to
jboss 4.2.1.

ML

On Thu, Oct 23, 2008 at 9:41 PM, Michael Lewis <mi...@mlcsoftware.com>wrote:

> I'm somewhat new to CXF myself, although I did some reading and the only
> thing that I can come up with is to add the following annotation to you
> ServiceEndpoint Interface under your @Webservice annotation.
>
> @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
> use=SOAPBinding.Use.LITERAL, parameterStyle =
> SOAPBinding.ParameterStyle.WRAPPED)
>
> I write webservices that are consumed by .net and I updated one of my
> parameters to use header = true, mode = WebParam.Mode.IN<http://webparam.mode.in/>,
> then imported the web service without problem in  VS 2005.
>
> The actual annotation that I used in my project was:  @SOAPBinding(style =
> SOAPBinding.Style.RPC, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED),
> but I read that you need to have DOC/Literal to use the soap header.
>
> Hope it helps.
>
> ML
>
>
> On Thu, Oct 23, 2008 at 2:24 AM, Bjørn T Johansen <bt...@havleik.no> wrote:
>
>> On Wed, 22 Oct 2008 13:42:01 -0400
>> Daniel Kulp <dk...@apache.org> wrote:
>>
>> >
>> > Quick questions:
>> >
>> > 1) What version of CXF?
>>
>> Was using 2.1.2 and now I tried with 2.1.3 with the same result..
>>
>> >
>> > 2) What version of the XmlSchema jar?
>>
>> 1.4.2
>>
>> >
>> > 3) Can you include the wsdl generated from that interface as well?
>>
>> Attached...
>>
>> >
>> > Jarek found a very similar error while integrating CXF 2.1.x into
>> Geronimo.
>> > It turned out it was due to picking up XmlSchema 1.3.3 instead of
>> 1.4.2.
>> > Once he managed to get maven to pick up the 1.4.2 version, it all worked
>> > fine.
>> >
>> > Dan
>> >
>> >
>> > On Wednesday 22 October 2008 3:08:03 am Bjørn T Johansen wrote:
>> > > I am trying to develop some web services using Java and CXF and the
>> > > clients that are going to use these are written in .Net.
>> > > But I am having a problem... When I add SOAP headers like this..:
>> > >
>> > > LogonServiceResponse logon(@WebParam(name = "userId") String userId,
>> > > @WebParam(name = "password") String password, @WebParam(name =
>> > > "soap_username", header = true, mode = WebParam.Mode.IN) String
>> > > soap_username, @WebParam(name = "soap_password", header = true, mode =
>> > > WebParam.Mode.IN) String soap_password);
>> > >
>> > >
>> > > (i.e the two last arguments), I get the following error from Visual
>> > > Studio when trying to add the web reference..:
>> > >
>> > > Custom tool error: Unable to import WebService/Schema. Unable to
>> > > import binding 'serviceSoapBinding' from namespace
>> > > 'http://webservices.domainservice.as.asp.no/'. Unable to import
>> > > operation 'logonService'. Part 'soap_username' from message
>> > > 'logonService' in namespace
>> > > 'http://webservices.domainservice.as.asp.no/' is missing the element
>> > > attribute. The element attribute is required for headers when
>> > > Use=Literal.
>> > >
>> > >
>> > > Can someone help me, this is my first try to make web services....
>> > >
>> > >
>> > >
>> > > Regards,
>> > >
>> > > BTJ
>> >
>> >
>> >
>>
>>
>

Re: Problem adding SOAP Headers and .Net?

Posted by Michael Lewis <mi...@mlcsoftware.com>.
I'm somewhat new to CXF myself, although I did some reading and the only
thing that I can come up with is to add the following annotation to you
ServiceEndpoint Interface under your @Webservice annotation.

@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
use=SOAPBinding.Use.LITERAL, parameterStyle =
SOAPBinding.ParameterStyle.WRAPPED)

I write webservices that are consumed by .net and I updated one of my
parameters to use header = true, mode =
WebParam.Mode.IN<http://webparam.mode.in/>,
then imported the web service without problem in  VS 2005.

The actual annotation that I used in my project was:  @SOAPBinding(style =
SOAPBinding.Style.RPC, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED),
but I read that you need to have DOC/Literal to use the soap header.

Hope it helps.

ML

On Thu, Oct 23, 2008 at 2:24 AM, Bjørn T Johansen <bt...@havleik.no> wrote:

> On Wed, 22 Oct 2008 13:42:01 -0400
> Daniel Kulp <dk...@apache.org> wrote:
>
> >
> > Quick questions:
> >
> > 1) What version of CXF?
>
> Was using 2.1.2 and now I tried with 2.1.3 with the same result..
>
> >
> > 2) What version of the XmlSchema jar?
>
> 1.4.2
>
> >
> > 3) Can you include the wsdl generated from that interface as well?
>
> Attached...
>
> >
> > Jarek found a very similar error while integrating CXF 2.1.x into
> Geronimo.
> > It turned out it was due to picking up XmlSchema 1.3.3 instead of 1.4.2.
> > Once he managed to get maven to pick up the 1.4.2 version, it all worked
> > fine.
> >
> > Dan
> >
> >
> > On Wednesday 22 October 2008 3:08:03 am Bjørn T Johansen wrote:
> > > I am trying to develop some web services using Java and CXF and the
> > > clients that are going to use these are written in .Net.
> > > But I am having a problem... When I add SOAP headers like this..:
> > >
> > > LogonServiceResponse logon(@WebParam(name = "userId") String userId,
> > > @WebParam(name = "password") String password, @WebParam(name =
> > > "soap_username", header = true, mode = WebParam.Mode.IN) String
> > > soap_username, @WebParam(name = "soap_password", header = true, mode =
> > > WebParam.Mode.IN) String soap_password);
> > >
> > >
> > > (i.e the two last arguments), I get the following error from Visual
> > > Studio when trying to add the web reference..:
> > >
> > > Custom tool error: Unable to import WebService/Schema. Unable to
> > > import binding 'serviceSoapBinding' from namespace
> > > 'http://webservices.domainservice.as.asp.no/'. Unable to import
> > > operation 'logonService'. Part 'soap_username' from message
> > > 'logonService' in namespace
> > > 'http://webservices.domainservice.as.asp.no/' is missing the element
> > > attribute. The element attribute is required for headers when
> > > Use=Literal.
> > >
> > >
> > > Can someone help me, this is my first try to make web services....
> > >
> > >
> > >
> > > Regards,
> > >
> > > BTJ
> >
> >
> >
>
>

Re: Problem adding SOAP Headers and .Net?

Posted by Bjørn T Johansen <bt...@havleik.no>.
On Wed, 22 Oct 2008 13:42:01 -0400
Daniel Kulp <dk...@apache.org> wrote:

> 
> Quick questions:
> 
> 1) What version of CXF?

Was using 2.1.2 and now I tried with 2.1.3 with the same result..

> 
> 2) What version of the XmlSchema jar?

1.4.2

> 
> 3) Can you include the wsdl generated from that interface as well?

Attached...

> 
> Jarek found a very similar error while integrating CXF 2.1.x into Geronimo.   
> It turned out it was due to picking up XmlSchema 1.3.3 instead of 1.4.2.   
> Once he managed to get maven to pick up the 1.4.2 version, it all worked 
> fine.
> 
> Dan
> 
> 
> On Wednesday 22 October 2008 3:08:03 am Bjørn T Johansen wrote:
> > I am trying to develop some web services using Java and CXF and the
> > clients that are going to use these are written in .Net.
> > But I am having a problem... When I add SOAP headers like this..:
> >
> > LogonServiceResponse logon(@WebParam(name = "userId") String userId,
> > @WebParam(name = "password") String password, @WebParam(name =
> > "soap_username", header = true, mode = WebParam.Mode.IN) String
> > soap_username, @WebParam(name = "soap_password", header = true, mode =
> > WebParam.Mode.IN) String soap_password);
> >
> >
> > (i.e the two last arguments), I get the following error from Visual
> > Studio when trying to add the web reference..:
> >
> > Custom tool error: Unable to import WebService/Schema. Unable to
> > import binding 'serviceSoapBinding' from namespace
> > 'http://webservices.domainservice.as.asp.no/'. Unable to import
> > operation 'logonService'. Part 'soap_username' from message
> > 'logonService' in namespace
> > 'http://webservices.domainservice.as.asp.no/' is missing the element
> > attribute. The element attribute is required for headers when
> > Use=Literal.
> >
> >
> > Can someone help me, this is my first try to make web services....
> >
> >
> >
> > Regards,
> >
> > BTJ
> 
> 
> 


Re: Problem adding SOAP Headers and .Net?

Posted by Daniel Kulp <dk...@apache.org>.
Quick questions:

1) What version of CXF?

2) What version of the XmlSchema jar?

3) Can you include the wsdl generated from that interface as well?

Jarek found a very similar error while integrating CXF 2.1.x into Geronimo.   
It turned out it was due to picking up XmlSchema 1.3.3 instead of 1.4.2.   
Once he managed to get maven to pick up the 1.4.2 version, it all worked 
fine.

Dan


On Wednesday 22 October 2008 3:08:03 am Bjørn T Johansen wrote:
> I am trying to develop some web services using Java and CXF and the
> clients that are going to use these are written in .Net.
> But I am having a problem... When I add SOAP headers like this..:
>
> LogonServiceResponse logon(@WebParam(name = "userId") String userId,
> @WebParam(name = "password") String password, @WebParam(name =
> "soap_username", header = true, mode = WebParam.Mode.IN) String
> soap_username, @WebParam(name = "soap_password", header = true, mode =
> WebParam.Mode.IN) String soap_password);
>
>
> (i.e the two last arguments), I get the following error from Visual
> Studio when trying to add the web reference..:
>
> Custom tool error: Unable to import WebService/Schema. Unable to
> import binding 'serviceSoapBinding' from namespace
> 'http://webservices.domainservice.as.asp.no/'. Unable to import
> operation 'logonService'. Part 'soap_username' from message
> 'logonService' in namespace
> 'http://webservices.domainservice.as.asp.no/' is missing the element
> attribute. The element attribute is required for headers when
> Use=Literal.
>
>
> Can someone help me, this is my first try to make web services....
>
>
>
> Regards,
>
> BTJ



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Problem adding SOAP Headers and .Net?

Posted by Bjørn T Johansen <bt...@havleik.no>.
Yes, here it is....

BTJ

On Wed, 22 Oct 2008 07:36:59 -0500
"Michael Lewis" <mi...@mlcsoftware.com> wrote:

> Bjorn,
> 
> Can you send your Service Endpoint Interface?
> 
> On Wed, Oct 22, 2008 at 2:08 AM, Bjørn T Johansen <bt...@havleik.no> wrote:
> 
> > I am trying to develop some web services using Java and CXF and the clients
> > that are going to use these are written in .Net.
> > But I am having a problem... When I add SOAP headers like this..:
> >
> > LogonServiceResponse logon(@WebParam(name = "userId") String userId,
> > @WebParam(name = "password") String password, @WebParam(name =
> > "soap_username", header = true, mode = WebParam.Mode.IN) String
> > soap_username, @WebParam(name = "soap_password", header = true, mode =
> > WebParam.Mode.IN) String soap_password);
> >
> >
> > (i.e the two last arguments), I get the following error from Visual Studio
> > when trying to add the web reference..:
> >
> > Custom tool error: Unable to import WebService/Schema. Unable to import
> > binding 'serviceSoapBinding' from namespace '
> > http://webservices.domainservice.as.asp.no/'. Unable to import operation
> > 'logonService'. Part 'soap_username' from message 'logonService' in
> > namespace 'http://webservices.domainservice.as.asp.no/' is missing the
> > element attribute. The element attribute is required for headers when
> > Use=Literal.
> >
> >
> > Can someone help me, this is my first try to make web services....
> >
> >
> >
> > Regards,
> >
> > BTJ
> >
> >
> > --
> >
> > -----------------------------------------------------------------------------------------------
> > Bjørn T Johansen
> >
> > btj@havleik.no
> >
> > -----------------------------------------------------------------------------------------------
> > Someone wrote:
> > "I understand that if you play a Windows CD backwards you hear strange
> > Satanic messages"
> > To which someone replied:
> > "It's even worse than that; play it forwards and it installs Windows"
> >
> > -----------------------------------------------------------------------------------------------
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >

Re: Problem adding SOAP Headers and .Net?

Posted by Michael Lewis <mi...@mlcsoftware.com>.
Bjorn,

Can you send your Service Endpoint Interface?

On Wed, Oct 22, 2008 at 2:08 AM, Bjørn T Johansen <bt...@havleik.no> wrote:

> I am trying to develop some web services using Java and CXF and the clients
> that are going to use these are written in .Net.
> But I am having a problem... When I add SOAP headers like this..:
>
> LogonServiceResponse logon(@WebParam(name = "userId") String userId,
> @WebParam(name = "password") String password, @WebParam(name =
> "soap_username", header = true, mode = WebParam.Mode.IN) String
> soap_username, @WebParam(name = "soap_password", header = true, mode =
> WebParam.Mode.IN) String soap_password);
>
>
> (i.e the two last arguments), I get the following error from Visual Studio
> when trying to add the web reference..:
>
> Custom tool error: Unable to import WebService/Schema. Unable to import
> binding 'serviceSoapBinding' from namespace '
> http://webservices.domainservice.as.asp.no/'. Unable to import operation
> 'logonService'. Part 'soap_username' from message 'logonService' in
> namespace 'http://webservices.domainservice.as.asp.no/' is missing the
> element attribute. The element attribute is required for headers when
> Use=Literal.
>
>
> Can someone help me, this is my first try to make web services....
>
>
>
> Regards,
>
> BTJ
>
>
> --
>
> -----------------------------------------------------------------------------------------------
> Bjørn T Johansen
>
> btj@havleik.no
>
> -----------------------------------------------------------------------------------------------
> Someone wrote:
> "I understand that if you play a Windows CD backwards you hear strange
> Satanic messages"
> To which someone replied:
> "It's even worse than that; play it forwards and it installs Windows"
>
> -----------------------------------------------------------------------------------------------
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>