You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Brown, Ben" <be...@bluefingroup.co.uk> on 2009/07/31 12:01:02 UTC

Error Parsing WSDL with CXF-BC

Hi All

 

I am attempting to connect to an external web service using a CXF-BC
provider.  On deployment of my service unit I am getting the following
exception thrown:

 

<loc-message>javax.wsdl.WSDLException: WSDLException:
faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
org.xml.sax.SAXParseException: The value of the attribute
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed namespace bindings may not be empty.</loc-message>

<stack-trace><![CDATA[javax.jbi.management.DeploymentException:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem
parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value
of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is
invalid. Prefixed namespace bindings may not be empty.

        at
org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:50
4)

        at
org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
java:58)

        at
org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanD
eployer.java:55)

        at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstract
XBeanDeployer.java:97)

        at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseService
UnitManager.java:88)

        at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUn
itManager.java:69)

        at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssem
bly(DeploymentService.java:520)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceA
ssembly(AutoDeploymentService.java:349)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(
AutoDeploymentService.java:255)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirecto
ry(AutoDeploymentService.java:658)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(Aut
oDeploymentService.java:63)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDepl
oymentService.java:622)

        at java.util.TimerThread.mainLoop(Timer.java:512)

        at java.util.TimerThread.run(Timer.java:462)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
org.xml.sax.SAXParseException: The value of the attribute
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed name

space bindings may not be empty.

        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)

        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)

        at
org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:47
4)

        ... 13 more

Caused by: org.xml.sax.SAXParseException: The value of the attribute
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed namespace bindings may not be empty.

        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)

        ... 16 more

]]></stack-trace> 

 

I have found a few messages on the mailing list that have similar
errors, however none seem to have any solutions - apologies if this is
not the case I have tried to search for an answer.

 

The WSDL that I am reading does not contain a namespace called ns1, so
first question - is this an exception to do with parsing the external
WSDL or something to do with an internally generated WSDL?

 

In either case, does anyone have any clue as to how this can be solve,
or the 'usual' causes for something like this.  I will probably be
unable to post a link to the WSDL easily, however I can try to obfuscate
out all identifying information if this would be useful to people.

 

Incidentally, originally the WSDL contained a target namespace of
http://tempuri.org <http://tempuri.org/>  - but I had this changed as
this appeared to cause errors where the target namespace did not match
the actual namespace for the service.  At this stage the SA would deploy
correctly with an error message, but no messages could be delivered as
it had obviously not parsed the WSDL correctly.

 

Thanks in advance.

 

Ben Brown

This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

RE: Error Parsing WSDL with CXF-BC

Posted by Madesclair Vivian <vm...@sopragroup.com>.
It was quite clear, thanks!

-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Envoyé : vendredi 31 juillet 2009 14:33
À : users@servicemix.apache.org
Objet : Re: Error Parsing WSDL with CXF-BC

Agreed Vivian,

My comment was more concerning the ns1 namespace. It's not because the provided WSDL doesn't contain the namespace that it can't be present in the exposed one.

The HTTP component especially can:
- generate a WSDL using an abstract one (for example provided by the target endpoint). The abstract WSDL contains only type, message and port type. It doesn't contain binding. In this case, the component import the abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case in the soap-consumer endpoint when the target one define an abstract WSDL (as it's the case for the exec component). I began a work to add abstract WSDL support in most of components.
- take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP component get the port type (the first one or the one corresponding to the service definition), delete all other port types, services, bindings and make a port type decoration. By port type decoration, I mean that it takes the original port type, the service name and construct the corresponding binding (it's done by PortTypeDecorator.decorate() method).

I hope that I was clear :)

Regards
JB

Madesclair Vivian wrote:
> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
> 
> Or maybe I am. And btw what is port decoration?
> 
> Regards,
> Vivian
> 
> 
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : vendredi 
> 31 juillet 2009 14:09 À : users@servicemix.apache.org Objet : Re: 
> Error Parsing WSDL with CXF-BC
> 
> No Vivian,
> 
> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
> 
> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Hi Ben
>>
>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>> from the SOAP message that your CXF component is sending to your 
>> external service. Do you know the content of this message? (You can 
>> activate debug mode of log4j if needed)
>>
>> If you still can't solve your problem, can you provide us with the 
>> content of the message and the wsdl? (you can attach the file)
>>
>> Regards
>> Vivian
>>
>> -----Message d'origine-----
>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>
>> Hi All
>>
>>  
>>
>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>
>>  
>>
>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed namespace bindings may not be empty.</loc-message>
>>
>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>
>>         at
>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>> 50
>> 4)
>>
>>         at
>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>> java:58)
>>
>>         at
>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBe
>> a
>> nD
>> eployer.java:55)
>>
>>         at
>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstr
>> a
>> ct
>> XBeanDeployer.java:97)
>>
>>         at
>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServ
>> i
>> ce
>> UnitManager.java:88)
>>
>>         at
>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServic
>> e
>> Un
>> itManager.java:69)
>>
>>         at
>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs
>> s
>> em
>> bly(DeploymentService.java:520)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServi
>> c
>> eA
>> ssembly(AutoDeploymentService.java:349)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi
>> v
>> e(
>> AutoDeploymentService.java:255)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDire
>> c
>> to
>> ry(AutoDeploymentService.java:658)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(
>> A
>> ut
>> oDeploymentService.java:63)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoD
>> e
>> pl
>> oymentService.java:622)
>>
>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>
>>         at java.util.TimerThread.run(Timer.java:462)
>>
>> Caused by: javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed name
>>
>> space bindings may not be empty.
>>
>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown 
>> Source)
>>
>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown 
>> Source)
>>
>>         at
>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>> 47
>> 4)
>>
>>         ... 13 more
>>
>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed namespace bindings may not be empty.
>>
>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>
>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>> Source)
>>
>>         ... 16 more
>>
>> ]]></stack-trace>
>>
>>  
>>
>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>
>>  
>>
>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>
>>  
>>
>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>
>>  
>>
>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>
>>  
>>
>> Thanks in advance.
>>
>>  
>>
>> Ben Brown
>>
>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>
>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Hi Freeman

I would like to thank you again for your help during this issue.  I have now come to a conclusion that fixes both this issue and another issues I was having [1].

I have create a custom interceptor that actually manually inserts the SecretToken header into the SoapMessage as this will always be a constant used only for security.  I had previously managed to create an interceptor that would remove the namespace form this element in my JBI message, however this left me with [1] still to solve.  I am not sure if it was my issue with namespaces that prevented me from being able to use a multi-part jbi message, but I could not get this to work.  I have to say that I was getting confusing results in the JbiOutInterceptor when reading my multi-part messages, as though it was comparing the wrong elements when looking for header elements.

The interceptor I came up with for anyone who is interested is shown at the bottom.

Ben

[1] http://www.nabble.com/Adding-SoapHeader-Information-using-CXF-BC-Provider-td24790696ef12049.html
 

public class EmbassyFundPricesWSDLInterceptor extends
		AbstractPhaseInterceptor<Message> {
	
	private String secretToken;

	public EmbassyFundPricesWSDLInterceptor() {
		super(Phase.PRE_STREAM);
	}

	public void handleMessage(Message message) {	
		List<Header> headerList = ((SoapMessage)message).getHeaders();
		
		// Xerces Parser Document - Required for creating nodes
		Document xmldoc= new DocumentImpl();
		
		// Create Child SecretToken node
		Element child = xmldoc.createElementNS("http://schemas.datacontract.org/2004/07/Test.SoapHeaderFactory", "SecretToken");
		child.setPrefix("win");
		child.setTextContent(this.secretToken);
		
		// Create Root Element
		Element root = xmldoc.createElementNS(null, "SecretToken");
		root.appendChild(child);
		
		// Add SoapHeader element to headers
		headerList.add(new Header(new QName(""), (Node)root));
	}

	public String getSecretToken() {
		return secretToken;
	}

	public void setSecretToken(String secretToken) {
		this.secretToken = secretToken;
	}
}





-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com] 
Sent: 06 August 2009 14:13
To: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Hi,
Set the PHASE as Phase.PRE_STREAM, which is same as  
LoggingOutInterceptor should be fine I believe.
At this phase the message already be Soap message, you can add  
LoggingOutInterceptor to see the std output, it's soap message.

About the debug issue in Eclipse, do you mean you can't add breakpoint  
for your interceptor? If so, seems you didn't import this source  
correctly into eclipse project.

If you mean you can't set breakpoint for cxf code, make sure you  
already import cxf source code into your eclipse already.

Freeman
On 2009-8-6, at 下午7:32, Brown, Ben wrote:

> Hi Freeman
>
> I have setup an out interceptor (initially a direct copy of the  
> LoggingOutInterceptor code), however there are a couple of questions  
> that I have.  At what phase in the interceptor chain should I  
> ideally be placing my interceptor?  I was thinking that I could put  
> it in the MARSHAL_ENDING phase and then I would be able to directly  
> manipulate the WSDL message, however whatever phase I put the  
> interceptor in the incoming message is always the JBI message.
>
> From this I take it that:
> * Every interceptor gets the JBI message as input
> * Some interceptors such as the JbiOutWsdl1Interceptor do not modify  
> this message (the parameter to handleMessage), but instead make  
> changes to 'another message' (sorry not sure how to phrase that!)
>
> Are my conclusions above correct? If so it would appear that I can  
> only modify the JBI message and that I must make my changes before  
> the JbiOutWsdl1Interceptor otherwise my changes will not go in the  
> actual soap message sent.
>
> All the evidence for the above was got by placing a method  
> breakpoint in Eclipse as I'm not actually able to step through (see  
> below).
>
> On a separate note, I'm having issues being able to debug my new  
> interceptor inside Eclipse - I'm getting the "unable to install  
> breakpoint due to missing line numbers" error.  I've checked my  
> global and project settings and these are fine, I've included  
> debug="true" on my javac build commands in ant.  The only thing I  
> can think it may be is a library issue (seen a few posts about  
> this), however I now have the same CXF libraries as in the cxf-bc  
> component:
> * cxf-rt-core-2.2.2.jar
> * cxf-api-2.2.2.jar
> * cxf-common-utilities-2.2.2.jar
>
> These are the only libraries I have in the whole project.  If anyone  
> has seen this and has any suggestions they would be much appreciated.
>
> Thanks
>
> Ben
>
>
>
>
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com]
> Sent: 05 August 2009 14:36
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
>
> Hi Ben,
>
> That's not only a wsdl problem, wsdl is just a contract between client
> and server, so even you change your wsdl on cxf bc provider side, your
> windows Visual studio server still hope a different incoming soap
> message (without namespace for soap header element).
> One possible way as workaround is you add your interceptor(you may
> need take a look at org.apache.cxf.interceptor.LoggingOutInterceptor
> as example) for cxf bc outInterceptor, in this interceptor you hack
> the soap message before the message sent out, remove the namespace
> from soap header element, which is your windows Visual studio server
> expected.
>
> Freeman
> On 2009-8-5, at 下午7:07, Brown, Ben wrote:
>
>> Hi Freeman
>>
>> Thanks for the reply; this at least makes it totally clear that my
>> problem is with the WSDL rather than in SM.
>>
>> Has anyone ever had to address this issue before and had to come up
>> with a workaround for invalid WSDL?  I know that one of the things
>> I'm going to find very hard to get changed is the WSDL - sadly this
>> might be another issue of Microsoft striking again...
>>
>> Thanks for all your help.
>>
>> Ben
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Freeman Fang [mailto:freeman.fang@gmail.com]
>> Sent: 05 August 2009 11:25
>> To: users@servicemix.apache.org
>> Subject: Re: Error Parsing WSDL with CXF-BC
>>
>> Hi
>>
>> I go through the wsdl file you appended, the problem comes from the
>> element SecretToken defined in one schema which has no
>> targetNamespace, this isn't WS-I BP compliant, per WS-I Basic Profile
>> 1.1[1],
>> R2105  All xsd:schema elements contained in a wsdl:types element of a
>> DESCRIPTION MUST have a targetNamespace attribute with a valid and
>> non-
>> null value, UNLESS the xsd:schema element has xsd:import and/or
>> xsd:annotation as its only child element(s).
>> Follow the rules of WS-I BP can ensure webservice client/service from
>> different party can communicate with each other.
>> [1]http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLTYPES
>> Freeman
>>
>> On 2009-8-5, at 下午4:38, Brown, Ben wrote:
>>
>>> Hi All
>>>
>>> I'm still battling with this, but I think I have just about
>>> exhausted my knowledge on exploring the issue.
>>>
>>> As I said below I can make the WSDL validate - but actually this
>>> makes the WSDL not function correctly, so the modifications are not
>>> really correct.
>>>
>>> I can see now that the issue does occur with the SecretToken  
>>> element:
>>>
>>> <xsd:schema elementFormDefault="qualified">
>>> <xsd:element name="SecretToken" nillable="true"
>>> type="q3:SecretHeader"
>>> 	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>>> " />
>>> </xsd:schema>
>>>
>>> This element has no namespace.  If I give it a namespace then the
>>> document will parse, however if I do this the message is no longer
>>> correctly formatted i.e. the no namespace is deliberate and
>>> necessary.
>>>
>>> This does parse correctly in SoapUI, so I believe that the issue
>>> with Servicemix is not allowing this to parse - when the namespace
>>> for this element is added to the list of elements in
>>> ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no
>>> URI and a temporary namespace prefix ns1 - however I believe that as
>>> this has no URI it really shouldn't be added to the list of
>>> namespaces?
>>>
>>> Things I know about the WSDL that may / may not be helpful.  The
>>> WSDL is generated from Visual Studio (an external company we are
>>> connecting to so no choice) automatically, which I why I believe it
>>> is not as 'clean' as some of the example WSDL's that are seen.  This
>>> may also explain the absence of namespace.
>>>
>>> I have attached a cut down version of the original WSDL, i.e.
>>> removed all unused types and only left 1 operation.  If anyone has
>>> time to have a quick look it would be much appreciated.
>>>
>>> Thanks
>>>
>>> Ben Brown
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Sent: 03 August 2009 13:30
>>> To: users@servicemix.apache.org
>>> Subject: RE: Error Parsing WSDL with CXF-BC
>>>
>>> Hi All
>>>
>>> An update on this issue.  I have now managed to get the CXF-BC
>>> component to parse the WSDL by modifying a couple of parts of it.  I
>>> have not as yet had time to work out the exact cause of this problem
>>> in the SM code. The elements I had to change were as follows:
>>>
>>> <xsd:schema elementFormDefault="qualified">
>>> 	<xsd:element name="SecretToken" nillable="true"
>>> type="win:SecretHeader"/>
>>> </xsd:schema>
>>>
>>> I had to move the namespace from this element and declare it on the
>>> root node of the WSDL.  This also required adding the namespace to a
>>> couple of nodes - same for the below two nodes:
>>>
>>> <wsdl:message
>>> name
>>> =
>>> "ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage
>>> ">
>>> 	<wsdl:part name="detail" element="q5:DetailedFault"/>
>>> </wsdl:message>
>>>
>>> <wsdl:message
>>> name
>>> ="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
>>> 		<wsdl:part name="detail" element="q5:DetailedFault"/>
>>> </wsdl:message>
>>>
>>> I will try to investigate the exact cause of this, but if anyone has
>>> time to look that would be great.  I simply found out the
>>> information above by debugging on the method shown in my previous
>>> post, I have not as yet worked out where the namespace is read, and
>>> why it does not try the local node to read the namespace from.
>>>
>>> Thanks
>>>
>>> Ben
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Sent: 31 July 2009 15:55
>>> To: jb@nanthrax.net
>>> Cc: users@servicemix.apache.org
>>> Subject: RE: Error Parsing WSDL with CXF-BC
>>>
>>> Hi JB
>>>
>>> Sorry I didn't attach the deployment log before - I have attached
>>> the full log - changed some of the URL's slightly.
>>>
>>> I have tracked things down further and the error actually seems to
>>> occur on the SecretToken element of the WSDL:
>>>
>>> <xsd:schema elementFormDefault="qualified">
>>>    <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>>> " name="SecretToken" nillable="true" type="q3:SecretHeader"/>
>>>  </xsd:schema>
>>>
>>> This appears to be the element where the namespace "ns1" with no URI
>>> is inserted into the namespaces element of the WSDL Definition (in
>>> ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).
>>>
>>> I don't think I have said this yet, but the reason I believe there
>>> might be an issue in SM is that SoapUI can communicate with this web
>>> service without error.
>>>
>>> If you need anything else please let me know.
>>>
>>> Ben
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>> Sent: 31 July 2009 14:56
>>> To: Brown, Ben
>>> Cc: users@servicemix.apache.org
>>> Subject: Re: Error Parsing WSDL with CXF-BC
>>>
>>> Hi Ben,
>>>
>>> correct, the load of the WSDL is made into the validate() method.
>>> It's
>>> here that the component get the target WSDL, parse it and load.
>>>
>>> On my side, I have requested the target WSDL and the deployment  
>>> debug
>>> log, to try to load it (in a debugged unit test) and see why we have
>>> an
>>> error in the javax.xml loader.
>>>
>>> Could you provide both please ?
>>>
>>> Regards
>>> JB
>>>
>>> Brown, Ben wrote:
>>>> Thanks for the quick answers JB, Vivian
>>>>
>>>> I have been exploring a little further and digging into the code.
>>>> It appears that the issue occurs during the validate method on
>>>> CxfBcProvider, specifically on:
>>>>
>>>> description = WSDLFactory.newInstance().newWSDLWriter()
>>>>                      .getDocument(swBuilder.build());
>>>>
>>>> It actually appears that during the build() method the Definition
>>>> that is returned, the map of namespaces inside contains a namespace
>>>> named ns1 but does not have a URI to go with that namespace.  This
>>>> seems to be where the ns1 is coming from, and the reason it is
>>>> blowing up.
>>>>
>>>> Looking at the WSDL (attached and company name removed), and then
>>>> checking the namespaces with those in the map during debugging, it
>>>> appears to be the http://schemas.microsoft.com/2003/10/
>>>> Serialization/ namespace that is causing the issues.  My thoughts
>>>> on why this might be the case are firstly that the xs namespace is
>>>> only declared on the first xs element and NOT on the
>>>> wsdl:definitions element and that possibly this is therefore not
>>>> picked up by the code.
>>>>
>>>> Both of you asked about the actual messages sent, however this
>>>> error is occurring during deployment of the component, and so I'm
>>>> not actually sending a Soap message as yet, because the component
>>>> won't deploy - so I'm doubting that it has anything to do with  
>>>> this.
>>>>
>>>> Please shout if you need any more information.
>>>>
>>>> Thanks
>>>>
>>>> Ben Brown
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>>> Sent: 31 July 2009 13:33
>>>> To: users@servicemix.apache.org
>>>> Subject: Re: Error Parsing WSDL with CXF-BC
>>>>
>>>> Agreed Vivian,
>>>>
>>>> My comment was more concerning the ns1 namespace. It's not because
>>>> the
>>>> provided WSDL doesn't contain the namespace that it can't be
>>>> present in
>>>> the exposed one.
>>>>
>>>> The HTTP component especially can:
>>>> - generate a WSDL using an abstract one (for example provided by  
>>>> the
>>>> target endpoint). The abstract WSDL contains only type, message and
>>>> port
>>>> type. It doesn't contain binding. In this case, the component
>>>> import the
>>>> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the
>>>> case
>>>> in the soap-consumer endpoint when the target one define an  
>>>> abstract
>>>> WSDL (as it's the case for the exec component). I began a work to
>>>> add
>>>> abstract WSDL support in most of components.
>>>> - take a WSDL and make cleanup on it. By cleanup, I mean that the
>>>> HTTP
>>>> component get the port type (the first one or the one corresponding
>>>> to
>>>> the service definition), delete all other port types, services,
>>>> bindings
>>>> and make a port type decoration. By port type decoration, I mean
>>>> that it
>>>> takes the original port type, the service name and construct the
>>>> corresponding binding (it's done by PortTypeDecorator.decorate()
>>>> method).
>>>>
>>>> I hope that I was clear :)
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> Madesclair Vivian wrote:
>>>>> Well my understanding is still limited, but the CXF component only
>>>>> add the SOAP wrapper right? So if the message, witch contains the
>>>>> tag of the method to call use an invalid namespace, it might go
>>>>> wrong. I didn't mean to say that the CXF sends a bad message, but
>>>>> the incoming message in CXF (and therefore the output) might be
>>>>> wrong.
>>>>>
>>>>> Or maybe I am. And btw what is port decoration?
>>>>>
>>>>> Regards,
>>>>> Vivian
>>>>>
>>>>>
>>>>> -----Message d'origine-----
>>>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>>>> Envoyé : vendredi 31 juillet 2009 14:09
>>>>> À : users@servicemix.apache.org
>>>>> Objet : Re: Error Parsing WSDL with CXF-BC
>>>>>
>>>>> No Vivian,
>>>>>
>>>>> HTTP and CXF-BC can use port decoration and so can add new binding
>>>>> and namespace.
>>>>>
>>>>> Ben, could you provide the target WSDL (the one used by the
>>>>> provider) and the SMX debug log file ? (I will check in the
>>>>> component).
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> Madesclair Vivian wrote:
>>>>>> Hi Ben
>>>>>>
>>>>>> If you wsdl doesnt contain a ns1 namespace, I guess the error
>>>>>> comes
>>>>>> from the SOAP message that your CXF component is sending to your
>>>>>> external service. Do you know the content of this message? (You
>>>>>> can
>>>>>> activate debug mode of log4j if needed)
>>>>>>
>>>>>> If you still can't solve your problem, can you provide us with  
>>>>>> the
>>>>>> content of the message and the wsdl? (you can attach the file)
>>>>>>
>>>>>> Regards
>>>>>> Vivian
>>>>>>
>>>>>> -----Message d'origine-----
>>>>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>>>>> Envoyé : vendredi 31 juillet 2009 12:01 À :
>>>>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF- 
>>>>>> BC
>>>>>>
>>>>>> Hi All
>>>>>>
>>>>>>
>>>>>>
>>>>>> I am attempting to connect to an external web service using a  
>>>>>> CXF-
>>>>>> BC provider.  On deployment of my service unit I am getting the
>>>>>> following exception thrown:
>>>>>>
>>>>>>
>>>>>>
>>>>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>>>>
>>>>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>>>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
>>>>>> Problem parsing '- WSDL Document -'.:
>>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>>> Prefixed namespace bindings may not be empty.
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>>> 50
>>>>>> 4)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>>>>> java:58)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>>>>> nD
>>>>>> eployer.java:55)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>>>>> ct
>>>>>> XBeanDeployer.java:97)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>>>>> ce
>>>>>> UnitManager.java:88)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>>>>> Un
>>>>>> itManager.java:69)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.DeploymentService.deployServiceAss
>>>>>> em
>>>>>> bly(DeploymentService.java:520)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateServic
>>>>>> eA
>>>>>> ssembly(AutoDeploymentService.java:349)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>>>>> e(
>>>>>> AutoDeploymentService.java:255)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>>>>> to
>>>>>> ry(AutoDeploymentService.java:658)
>>>>>>
>>>>>>      at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access
>>>>>> $800(A
>>>>>> ut
>>>>>> oDeploymentService.java:63)
>>>>>>
>>>>>>      at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService
>>>>>> $1.run(AutoDe
>>>>>> pl
>>>>>> oymentService.java:622)
>>>>>>
>>>>>>      at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>>>
>>>>>>      at java.util.TimerThread.run(Timer.java:462)
>>>>>>
>>>>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>>> Prefixed name
>>>>>>
>>>>>> space bindings may not be empty.
>>>>>>
>>>>>>      at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>>> Source)
>>>>>>
>>>>>>      at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>>> Source)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>>> 47
>>>>>> 4)
>>>>>>
>>>>>>      ... 13 more
>>>>>>
>>>>>> Caused by: org.xml.sax.SAXParseException: The value of the
>>>>>> attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is
>>>>>> invalid.
>>>>>> Prefixed namespace bindings may not be empty.
>>>>>>
>>>>>>      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>>>>
>>>>>>      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>>>>> Source)
>>>>>>
>>>>>>      ... 16 more
>>>>>>
>>>>>> ]]></stack-trace>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I have found a few messages on the mailing list that have similar
>>>>>> errors, however none seem to have any solutions - apologies if
>>>>>> this is not the case I have tried to search for an answer.
>>>>>>
>>>>>>
>>>>>>
>>>>>> The WSDL that I am reading does not contain a namespace called
>>>>>> ns1, so first question - is this an exception to do with parsing
>>>>>> the external WSDL or something to do with an internally generated
>>>>>> WSDL?
>>>>>>
>>>>>>
>>>>>>
>>>>>> In either case, does anyone have any clue as to how this can be
>>>>>> solve, or the 'usual' causes for something like this.  I will
>>>>>> probably be unable to post a link to the WSDL easily, however I
>>>>>> can try to obfuscate out all identifying information if this
>>>>>> would be useful to people.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Incidentally, originally the WSDL contained a target namespace
>>>>>> of http://tempuri.org
>>>>>> <http://tempuri.org/>  - but I had this changed as this appeared
>>>>>> to cause errors where the target namespace did not match the
>>>>>> actual namespace for the service.  At this stage the SA would
>>>>>> deploy correctly with an error message, but no messages could be
>>>>>> delivered as it had obviously not parsed the WSDL correctly.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ben Brown
>>>>>>
>>>>>> This email and any files or information it contains are
>>>>>> confidential and may be privileged.  It is for the intended
>>>>>> addressee(s) only.  The unauthorised use, disclosure or copying
>>>>>> of this email or any information it contains, is prohibited and
>>>>>> could, in certain circumstances be a criminal offence. If you are
>>>>>> not the intended recipient you should not disseminate or copy
>>>>>> this email.  Please notify the sender immediately and delete this
>>>>>> message from your system.
>>>>>>
>>>>>> Please note that any opinions presented in this email are solely
>>>>>> those of the author (or those of a third party whose statement is
>>>>>> forwarded) and do not necessarily represent those of any company
>>>>>> within the Bluefin Group Limited group of companies.
>>>>>>
>>>>>> Email transmission cannot be guaranteed to be secure or error
>>>>>> free as information could be intercepted, corrupted, lost,
>>>>>> destroyed, late in arriving or incomplete as a result of the
>>>>>> transmission process.  The sender therefore does not accept
>>>>>> liability for any errors or omissions in the contents of this
>>>>>> message which arise as a result of email transmission.
>>>>>>
>>>>>> WARNING: Computer viruses can be transmitted by email. The
>>>>>> recipient should check this email and any attachments for the
>>>>>> presence of viruses.  The Bluefin Group Limited group of
>>>>>> companies accepts no liability for any damage caused by any virus
>>>>>> transmitted by this email.
>>>>
>>>> --------------------------------------------------------------
>>>> Protection | Management | Compliance - scanned for viruses and
>>>> unwanted content by emailsystems
>>>>
>>>> Why use a managed email service? Click here to find out
>>>> This email and any files or information it contains are
>>>> confidential and may be privileged.  It is for the intended
>>>> addressee(s) only.  The unauthorised use, disclosure or copying of
>>>> this email or any information it contains, is prohibited and could,
>>>> in certain circumstances be a criminal offence. If you are not the
>>>> intended recipient you should not disseminate or copy this email.
>>>> Please notify the sender immediately and delete this message from
>>>> your system.
>>>>
>>>> Please note that any opinions presented in this email are solely
>>>> those of the author (or those of a third party whose statement is
>>>> forwarded) and do not necessarily represent those of any company
>>>> within the Bluefin Group Limited group of companies.
>>>>
>>>> Email transmission cannot be guaranteed to be secure or error free
>>>> as information could be intercepted, corrupted, lost, destroyed,
>>>> late in arriving or incomplete as a result of the transmission
>>>> process.  The sender therefore does not accept liability for any
>>>> errors or omissions in the contents of this message which arise as
>>>> a result of email transmission.
>>>>
>>>> WARNING: Computer viruses can be transmitted by email. The
>>>> recipient should check this email and any attachments for the
>>>> presence of viruses.  The Bluefin Group Limited group of companies
>>>> accepts no liability for any damage caused by any virus transmitted
>>>> by this email.
>>>>
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are confidential
>>> and may be privileged.  It is for the intended addressee(s) only.
>>> The unauthorised use, disclosure or copying of this email or any
>>> information it contains, is prohibited and could, in certain
>>> circumstances be a criminal offence. If you are not the intended
>>> recipient you should not disseminate or copy this email.  Please
>>> notify the sender immediately and delete this message from your
>>> system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as a
>>> result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient
>>> should check this email and any attachments for the presence of
>>> viruses.  The Bluefin Group Limited group of companies accepts no
>>> liability for any damage caused by any virus transmitted by this
>>> email.
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are confidential
>>> and may be privileged.  It is for the intended addressee(s) only.
>>> The unauthorised use, disclosure or copying of this email or any
>>> information it contains, is prohibited and could, in certain
>>> circumstances be a criminal offence. If you are not the intended
>>> recipient you should not disseminate or copy this email.  Please
>>> notify the sender immediately and delete this message from your
>>> system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as a
>>> result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient
>>> should check this email and any attachments for the presence of
>>> viruses.  The Bluefin Group Limited group of companies accepts no
>>> liability for any damage caused by any virus transmitted by this
>>> email.
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are confidential
>>> and may be privileged.  It is for the intended addressee(s) only.
>>> The unauthorised use, disclosure or copying of this email or any
>>> information it contains, is prohibited and could, in certain
>>> circumstances be a criminal offence. If you are not the intended
>>> recipient you should not disseminate or copy this email.  Please
>>> notify the sender immediately and delete this message from your
>>> system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as a
>>> result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient
>>> should check this email and any attachments for the presence of
>>> viruses.  The Bluefin Group Limited group of companies accepts no
>>> liability for any damage caused by any virus transmitted by this
>>> email.
>>
>>
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>>
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>>
>
>
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
>
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
>
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out

This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.


Re: Error Parsing WSDL with CXF-BC

Posted by Freeman Fang <fr...@gmail.com>.
Hi,
Set the PHASE as Phase.PRE_STREAM, which is same as  
LoggingOutInterceptor should be fine I believe.
At this phase the message already be Soap message, you can add  
LoggingOutInterceptor to see the std output, it's soap message.

About the debug issue in Eclipse, do you mean you can't add breakpoint  
for your interceptor? If so, seems you didn't import this source  
correctly into eclipse project.

If you mean you can't set breakpoint for cxf code, make sure you  
already import cxf source code into your eclipse already.

Freeman
On 2009-8-6, at 下午7:32, Brown, Ben wrote:

> Hi Freeman
>
> I have setup an out interceptor (initially a direct copy of the  
> LoggingOutInterceptor code), however there are a couple of questions  
> that I have.  At what phase in the interceptor chain should I  
> ideally be placing my interceptor?  I was thinking that I could put  
> it in the MARSHAL_ENDING phase and then I would be able to directly  
> manipulate the WSDL message, however whatever phase I put the  
> interceptor in the incoming message is always the JBI message.
>
> From this I take it that:
> * Every interceptor gets the JBI message as input
> * Some interceptors such as the JbiOutWsdl1Interceptor do not modify  
> this message (the parameter to handleMessage), but instead make  
> changes to 'another message' (sorry not sure how to phrase that!)
>
> Are my conclusions above correct? If so it would appear that I can  
> only modify the JBI message and that I must make my changes before  
> the JbiOutWsdl1Interceptor otherwise my changes will not go in the  
> actual soap message sent.
>
> All the evidence for the above was got by placing a method  
> breakpoint in Eclipse as I'm not actually able to step through (see  
> below).
>
> On a separate note, I'm having issues being able to debug my new  
> interceptor inside Eclipse - I'm getting the "unable to install  
> breakpoint due to missing line numbers" error.  I've checked my  
> global and project settings and these are fine, I've included  
> debug="true" on my javac build commands in ant.  The only thing I  
> can think it may be is a library issue (seen a few posts about  
> this), however I now have the same CXF libraries as in the cxf-bc  
> component:
> * cxf-rt-core-2.2.2.jar
> * cxf-api-2.2.2.jar
> * cxf-common-utilities-2.2.2.jar
>
> These are the only libraries I have in the whole project.  If anyone  
> has seen this and has any suggestions they would be much appreciated.
>
> Thanks
>
> Ben
>
>
>
>
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com]
> Sent: 05 August 2009 14:36
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
>
> Hi Ben,
>
> That's not only a wsdl problem, wsdl is just a contract between client
> and server, so even you change your wsdl on cxf bc provider side, your
> windows Visual studio server still hope a different incoming soap
> message (without namespace for soap header element).
> One possible way as workaround is you add your interceptor(you may
> need take a look at org.apache.cxf.interceptor.LoggingOutInterceptor
> as example) for cxf bc outInterceptor, in this interceptor you hack
> the soap message before the message sent out, remove the namespace
> from soap header element, which is your windows Visual studio server
> expected.
>
> Freeman
> On 2009-8-5, at 下午7:07, Brown, Ben wrote:
>
>> Hi Freeman
>>
>> Thanks for the reply; this at least makes it totally clear that my
>> problem is with the WSDL rather than in SM.
>>
>> Has anyone ever had to address this issue before and had to come up
>> with a workaround for invalid WSDL?  I know that one of the things
>> I'm going to find very hard to get changed is the WSDL - sadly this
>> might be another issue of Microsoft striking again...
>>
>> Thanks for all your help.
>>
>> Ben
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Freeman Fang [mailto:freeman.fang@gmail.com]
>> Sent: 05 August 2009 11:25
>> To: users@servicemix.apache.org
>> Subject: Re: Error Parsing WSDL with CXF-BC
>>
>> Hi
>>
>> I go through the wsdl file you appended, the problem comes from the
>> element SecretToken defined in one schema which has no
>> targetNamespace, this isn't WS-I BP compliant, per WS-I Basic Profile
>> 1.1[1],
>> R2105  All xsd:schema elements contained in a wsdl:types element of a
>> DESCRIPTION MUST have a targetNamespace attribute with a valid and
>> non-
>> null value, UNLESS the xsd:schema element has xsd:import and/or
>> xsd:annotation as its only child element(s).
>> Follow the rules of WS-I BP can ensure webservice client/service from
>> different party can communicate with each other.
>> [1]http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLTYPES
>> Freeman
>>
>> On 2009-8-5, at 下午4:38, Brown, Ben wrote:
>>
>>> Hi All
>>>
>>> I'm still battling with this, but I think I have just about
>>> exhausted my knowledge on exploring the issue.
>>>
>>> As I said below I can make the WSDL validate - but actually this
>>> makes the WSDL not function correctly, so the modifications are not
>>> really correct.
>>>
>>> I can see now that the issue does occur with the SecretToken  
>>> element:
>>>
>>> <xsd:schema elementFormDefault="qualified">
>>> <xsd:element name="SecretToken" nillable="true"
>>> type="q3:SecretHeader"
>>> 	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>>> " />
>>> </xsd:schema>
>>>
>>> This element has no namespace.  If I give it a namespace then the
>>> document will parse, however if I do this the message is no longer
>>> correctly formatted i.e. the no namespace is deliberate and
>>> necessary.
>>>
>>> This does parse correctly in SoapUI, so I believe that the issue
>>> with Servicemix is not allowing this to parse - when the namespace
>>> for this element is added to the list of elements in
>>> ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no
>>> URI and a temporary namespace prefix ns1 - however I believe that as
>>> this has no URI it really shouldn't be added to the list of
>>> namespaces?
>>>
>>> Things I know about the WSDL that may / may not be helpful.  The
>>> WSDL is generated from Visual Studio (an external company we are
>>> connecting to so no choice) automatically, which I why I believe it
>>> is not as 'clean' as some of the example WSDL's that are seen.  This
>>> may also explain the absence of namespace.
>>>
>>> I have attached a cut down version of the original WSDL, i.e.
>>> removed all unused types and only left 1 operation.  If anyone has
>>> time to have a quick look it would be much appreciated.
>>>
>>> Thanks
>>>
>>> Ben Brown
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Sent: 03 August 2009 13:30
>>> To: users@servicemix.apache.org
>>> Subject: RE: Error Parsing WSDL with CXF-BC
>>>
>>> Hi All
>>>
>>> An update on this issue.  I have now managed to get the CXF-BC
>>> component to parse the WSDL by modifying a couple of parts of it.  I
>>> have not as yet had time to work out the exact cause of this problem
>>> in the SM code. The elements I had to change were as follows:
>>>
>>> <xsd:schema elementFormDefault="qualified">
>>> 	<xsd:element name="SecretToken" nillable="true"
>>> type="win:SecretHeader"/>
>>> </xsd:schema>
>>>
>>> I had to move the namespace from this element and declare it on the
>>> root node of the WSDL.  This also required adding the namespace to a
>>> couple of nodes - same for the below two nodes:
>>>
>>> <wsdl:message
>>> name
>>> =
>>> "ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage
>>> ">
>>> 	<wsdl:part name="detail" element="q5:DetailedFault"/>
>>> </wsdl:message>
>>>
>>> <wsdl:message
>>> name
>>> ="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
>>> 		<wsdl:part name="detail" element="q5:DetailedFault"/>
>>> </wsdl:message>
>>>
>>> I will try to investigate the exact cause of this, but if anyone has
>>> time to look that would be great.  I simply found out the
>>> information above by debugging on the method shown in my previous
>>> post, I have not as yet worked out where the namespace is read, and
>>> why it does not try the local node to read the namespace from.
>>>
>>> Thanks
>>>
>>> Ben
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Sent: 31 July 2009 15:55
>>> To: jb@nanthrax.net
>>> Cc: users@servicemix.apache.org
>>> Subject: RE: Error Parsing WSDL with CXF-BC
>>>
>>> Hi JB
>>>
>>> Sorry I didn't attach the deployment log before - I have attached
>>> the full log - changed some of the URL's slightly.
>>>
>>> I have tracked things down further and the error actually seems to
>>> occur on the SecretToken element of the WSDL:
>>>
>>> <xsd:schema elementFormDefault="qualified">
>>>    <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>>> " name="SecretToken" nillable="true" type="q3:SecretHeader"/>
>>>  </xsd:schema>
>>>
>>> This appears to be the element where the namespace "ns1" with no URI
>>> is inserted into the namespaces element of the WSDL Definition (in
>>> ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).
>>>
>>> I don't think I have said this yet, but the reason I believe there
>>> might be an issue in SM is that SoapUI can communicate with this web
>>> service without error.
>>>
>>> If you need anything else please let me know.
>>>
>>> Ben
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>> Sent: 31 July 2009 14:56
>>> To: Brown, Ben
>>> Cc: users@servicemix.apache.org
>>> Subject: Re: Error Parsing WSDL with CXF-BC
>>>
>>> Hi Ben,
>>>
>>> correct, the load of the WSDL is made into the validate() method.
>>> It's
>>> here that the component get the target WSDL, parse it and load.
>>>
>>> On my side, I have requested the target WSDL and the deployment  
>>> debug
>>> log, to try to load it (in a debugged unit test) and see why we have
>>> an
>>> error in the javax.xml loader.
>>>
>>> Could you provide both please ?
>>>
>>> Regards
>>> JB
>>>
>>> Brown, Ben wrote:
>>>> Thanks for the quick answers JB, Vivian
>>>>
>>>> I have been exploring a little further and digging into the code.
>>>> It appears that the issue occurs during the validate method on
>>>> CxfBcProvider, specifically on:
>>>>
>>>> description = WSDLFactory.newInstance().newWSDLWriter()
>>>>                      .getDocument(swBuilder.build());
>>>>
>>>> It actually appears that during the build() method the Definition
>>>> that is returned, the map of namespaces inside contains a namespace
>>>> named ns1 but does not have a URI to go with that namespace.  This
>>>> seems to be where the ns1 is coming from, and the reason it is
>>>> blowing up.
>>>>
>>>> Looking at the WSDL (attached and company name removed), and then
>>>> checking the namespaces with those in the map during debugging, it
>>>> appears to be the http://schemas.microsoft.com/2003/10/
>>>> Serialization/ namespace that is causing the issues.  My thoughts
>>>> on why this might be the case are firstly that the xs namespace is
>>>> only declared on the first xs element and NOT on the
>>>> wsdl:definitions element and that possibly this is therefore not
>>>> picked up by the code.
>>>>
>>>> Both of you asked about the actual messages sent, however this
>>>> error is occurring during deployment of the component, and so I'm
>>>> not actually sending a Soap message as yet, because the component
>>>> won't deploy - so I'm doubting that it has anything to do with  
>>>> this.
>>>>
>>>> Please shout if you need any more information.
>>>>
>>>> Thanks
>>>>
>>>> Ben Brown
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>>> Sent: 31 July 2009 13:33
>>>> To: users@servicemix.apache.org
>>>> Subject: Re: Error Parsing WSDL with CXF-BC
>>>>
>>>> Agreed Vivian,
>>>>
>>>> My comment was more concerning the ns1 namespace. It's not because
>>>> the
>>>> provided WSDL doesn't contain the namespace that it can't be
>>>> present in
>>>> the exposed one.
>>>>
>>>> The HTTP component especially can:
>>>> - generate a WSDL using an abstract one (for example provided by  
>>>> the
>>>> target endpoint). The abstract WSDL contains only type, message and
>>>> port
>>>> type. It doesn't contain binding. In this case, the component
>>>> import the
>>>> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the
>>>> case
>>>> in the soap-consumer endpoint when the target one define an  
>>>> abstract
>>>> WSDL (as it's the case for the exec component). I began a work to
>>>> add
>>>> abstract WSDL support in most of components.
>>>> - take a WSDL and make cleanup on it. By cleanup, I mean that the
>>>> HTTP
>>>> component get the port type (the first one or the one corresponding
>>>> to
>>>> the service definition), delete all other port types, services,
>>>> bindings
>>>> and make a port type decoration. By port type decoration, I mean
>>>> that it
>>>> takes the original port type, the service name and construct the
>>>> corresponding binding (it's done by PortTypeDecorator.decorate()
>>>> method).
>>>>
>>>> I hope that I was clear :)
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> Madesclair Vivian wrote:
>>>>> Well my understanding is still limited, but the CXF component only
>>>>> add the SOAP wrapper right? So if the message, witch contains the
>>>>> tag of the method to call use an invalid namespace, it might go
>>>>> wrong. I didn't mean to say that the CXF sends a bad message, but
>>>>> the incoming message in CXF (and therefore the output) might be
>>>>> wrong.
>>>>>
>>>>> Or maybe I am. And btw what is port decoration?
>>>>>
>>>>> Regards,
>>>>> Vivian
>>>>>
>>>>>
>>>>> -----Message d'origine-----
>>>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>>>> Envoyé : vendredi 31 juillet 2009 14:09
>>>>> À : users@servicemix.apache.org
>>>>> Objet : Re: Error Parsing WSDL with CXF-BC
>>>>>
>>>>> No Vivian,
>>>>>
>>>>> HTTP and CXF-BC can use port decoration and so can add new binding
>>>>> and namespace.
>>>>>
>>>>> Ben, could you provide the target WSDL (the one used by the
>>>>> provider) and the SMX debug log file ? (I will check in the
>>>>> component).
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> Madesclair Vivian wrote:
>>>>>> Hi Ben
>>>>>>
>>>>>> If you wsdl doesnt contain a ns1 namespace, I guess the error
>>>>>> comes
>>>>>> from the SOAP message that your CXF component is sending to your
>>>>>> external service. Do you know the content of this message? (You
>>>>>> can
>>>>>> activate debug mode of log4j if needed)
>>>>>>
>>>>>> If you still can't solve your problem, can you provide us with  
>>>>>> the
>>>>>> content of the message and the wsdl? (you can attach the file)
>>>>>>
>>>>>> Regards
>>>>>> Vivian
>>>>>>
>>>>>> -----Message d'origine-----
>>>>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>>>>> Envoyé : vendredi 31 juillet 2009 12:01 À :
>>>>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF- 
>>>>>> BC
>>>>>>
>>>>>> Hi All
>>>>>>
>>>>>>
>>>>>>
>>>>>> I am attempting to connect to an external web service using a  
>>>>>> CXF-
>>>>>> BC provider.  On deployment of my service unit I am getting the
>>>>>> following exception thrown:
>>>>>>
>>>>>>
>>>>>>
>>>>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>>>>
>>>>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>>>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
>>>>>> Problem parsing '- WSDL Document -'.:
>>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>>> Prefixed namespace bindings may not be empty.
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>>> 50
>>>>>> 4)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>>>>> java:58)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>>>>> nD
>>>>>> eployer.java:55)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>>>>> ct
>>>>>> XBeanDeployer.java:97)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>>>>> ce
>>>>>> UnitManager.java:88)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>>>>> Un
>>>>>> itManager.java:69)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.DeploymentService.deployServiceAss
>>>>>> em
>>>>>> bly(DeploymentService.java:520)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateServic
>>>>>> eA
>>>>>> ssembly(AutoDeploymentService.java:349)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>>>>> e(
>>>>>> AutoDeploymentService.java:255)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>>>>> to
>>>>>> ry(AutoDeploymentService.java:658)
>>>>>>
>>>>>>      at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access
>>>>>> $800(A
>>>>>> ut
>>>>>> oDeploymentService.java:63)
>>>>>>
>>>>>>      at
>>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService
>>>>>> $1.run(AutoDe
>>>>>> pl
>>>>>> oymentService.java:622)
>>>>>>
>>>>>>      at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>>>
>>>>>>      at java.util.TimerThread.run(Timer.java:462)
>>>>>>
>>>>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>>> Prefixed name
>>>>>>
>>>>>> space bindings may not be empty.
>>>>>>
>>>>>>      at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>>> Source)
>>>>>>
>>>>>>      at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>>> Source)
>>>>>>
>>>>>>      at
>>>>>> org
>>>>>> .apache
>>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>>> 47
>>>>>> 4)
>>>>>>
>>>>>>      ... 13 more
>>>>>>
>>>>>> Caused by: org.xml.sax.SAXParseException: The value of the
>>>>>> attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is
>>>>>> invalid.
>>>>>> Prefixed namespace bindings may not be empty.
>>>>>>
>>>>>>      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>>>>
>>>>>>      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>>>>> Source)
>>>>>>
>>>>>>      ... 16 more
>>>>>>
>>>>>> ]]></stack-trace>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I have found a few messages on the mailing list that have similar
>>>>>> errors, however none seem to have any solutions - apologies if
>>>>>> this is not the case I have tried to search for an answer.
>>>>>>
>>>>>>
>>>>>>
>>>>>> The WSDL that I am reading does not contain a namespace called
>>>>>> ns1, so first question - is this an exception to do with parsing
>>>>>> the external WSDL or something to do with an internally generated
>>>>>> WSDL?
>>>>>>
>>>>>>
>>>>>>
>>>>>> In either case, does anyone have any clue as to how this can be
>>>>>> solve, or the 'usual' causes for something like this.  I will
>>>>>> probably be unable to post a link to the WSDL easily, however I
>>>>>> can try to obfuscate out all identifying information if this
>>>>>> would be useful to people.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Incidentally, originally the WSDL contained a target namespace
>>>>>> of http://tempuri.org
>>>>>> <http://tempuri.org/>  - but I had this changed as this appeared
>>>>>> to cause errors where the target namespace did not match the
>>>>>> actual namespace for the service.  At this stage the SA would
>>>>>> deploy correctly with an error message, but no messages could be
>>>>>> delivered as it had obviously not parsed the WSDL correctly.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ben Brown
>>>>>>
>>>>>> This email and any files or information it contains are
>>>>>> confidential and may be privileged.  It is for the intended
>>>>>> addressee(s) only.  The unauthorised use, disclosure or copying
>>>>>> of this email or any information it contains, is prohibited and
>>>>>> could, in certain circumstances be a criminal offence. If you are
>>>>>> not the intended recipient you should not disseminate or copy
>>>>>> this email.  Please notify the sender immediately and delete this
>>>>>> message from your system.
>>>>>>
>>>>>> Please note that any opinions presented in this email are solely
>>>>>> those of the author (or those of a third party whose statement is
>>>>>> forwarded) and do not necessarily represent those of any company
>>>>>> within the Bluefin Group Limited group of companies.
>>>>>>
>>>>>> Email transmission cannot be guaranteed to be secure or error
>>>>>> free as information could be intercepted, corrupted, lost,
>>>>>> destroyed, late in arriving or incomplete as a result of the
>>>>>> transmission process.  The sender therefore does not accept
>>>>>> liability for any errors or omissions in the contents of this
>>>>>> message which arise as a result of email transmission.
>>>>>>
>>>>>> WARNING: Computer viruses can be transmitted by email. The
>>>>>> recipient should check this email and any attachments for the
>>>>>> presence of viruses.  The Bluefin Group Limited group of
>>>>>> companies accepts no liability for any damage caused by any virus
>>>>>> transmitted by this email.
>>>>
>>>> --------------------------------------------------------------
>>>> Protection | Management | Compliance - scanned for viruses and
>>>> unwanted content by emailsystems
>>>>
>>>> Why use a managed email service? Click here to find out
>>>> This email and any files or information it contains are
>>>> confidential and may be privileged.  It is for the intended
>>>> addressee(s) only.  The unauthorised use, disclosure or copying of
>>>> this email or any information it contains, is prohibited and could,
>>>> in certain circumstances be a criminal offence. If you are not the
>>>> intended recipient you should not disseminate or copy this email.
>>>> Please notify the sender immediately and delete this message from
>>>> your system.
>>>>
>>>> Please note that any opinions presented in this email are solely
>>>> those of the author (or those of a third party whose statement is
>>>> forwarded) and do not necessarily represent those of any company
>>>> within the Bluefin Group Limited group of companies.
>>>>
>>>> Email transmission cannot be guaranteed to be secure or error free
>>>> as information could be intercepted, corrupted, lost, destroyed,
>>>> late in arriving or incomplete as a result of the transmission
>>>> process.  The sender therefore does not accept liability for any
>>>> errors or omissions in the contents of this message which arise as
>>>> a result of email transmission.
>>>>
>>>> WARNING: Computer viruses can be transmitted by email. The
>>>> recipient should check this email and any attachments for the
>>>> presence of viruses.  The Bluefin Group Limited group of companies
>>>> accepts no liability for any damage caused by any virus transmitted
>>>> by this email.
>>>>
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are confidential
>>> and may be privileged.  It is for the intended addressee(s) only.
>>> The unauthorised use, disclosure or copying of this email or any
>>> information it contains, is prohibited and could, in certain
>>> circumstances be a criminal offence. If you are not the intended
>>> recipient you should not disseminate or copy this email.  Please
>>> notify the sender immediately and delete this message from your
>>> system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as a
>>> result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient
>>> should check this email and any attachments for the presence of
>>> viruses.  The Bluefin Group Limited group of companies accepts no
>>> liability for any damage caused by any virus transmitted by this
>>> email.
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are confidential
>>> and may be privileged.  It is for the intended addressee(s) only.
>>> The unauthorised use, disclosure or copying of this email or any
>>> information it contains, is prohibited and could, in certain
>>> circumstances be a criminal offence. If you are not the intended
>>> recipient you should not disseminate or copy this email.  Please
>>> notify the sender immediately and delete this message from your
>>> system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as a
>>> result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient
>>> should check this email and any attachments for the presence of
>>> viruses.  The Bluefin Group Limited group of companies accepts no
>>> liability for any damage caused by any virus transmitted by this
>>> email.
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are confidential
>>> and may be privileged.  It is for the intended addressee(s) only.
>>> The unauthorised use, disclosure or copying of this email or any
>>> information it contains, is prohibited and could, in certain
>>> circumstances be a criminal offence. If you are not the intended
>>> recipient you should not disseminate or copy this email.  Please
>>> notify the sender immediately and delete this message from your
>>> system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as a
>>> result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient
>>> should check this email and any attachments for the presence of
>>> viruses.  The Bluefin Group Limited group of companies accepts no
>>> liability for any damage caused by any virus transmitted by this
>>> email.
>>
>>
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>>
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>>
>
>
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
>
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
>
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Hi Freeman

I have setup an out interceptor (initially a direct copy of the LoggingOutInterceptor code), however there are a couple of questions that I have.  At what phase in the interceptor chain should I ideally be placing my interceptor?  I was thinking that I could put it in the MARSHAL_ENDING phase and then I would be able to directly manipulate the WSDL message, however whatever phase I put the interceptor in the incoming message is always the JBI message.  

From this I take it that:
* Every interceptor gets the JBI message as input
* Some interceptors such as the JbiOutWsdl1Interceptor do not modify this message (the parameter to handleMessage), but instead make changes to 'another message' (sorry not sure how to phrase that!)

Are my conclusions above correct? If so it would appear that I can only modify the JBI message and that I must make my changes before the JbiOutWsdl1Interceptor otherwise my changes will not go in the actual soap message sent.

All the evidence for the above was got by placing a method breakpoint in Eclipse as I'm not actually able to step through (see below).

On a separate note, I'm having issues being able to debug my new interceptor inside Eclipse - I'm getting the "unable to install breakpoint due to missing line numbers" error.  I've checked my global and project settings and these are fine, I've included debug="true" on my javac build commands in ant.  The only thing I can think it may be is a library issue (seen a few posts about this), however I now have the same CXF libraries as in the cxf-bc component:
* cxf-rt-core-2.2.2.jar
* cxf-api-2.2.2.jar
* cxf-common-utilities-2.2.2.jar

These are the only libraries I have in the whole project.  If anyone has seen this and has any suggestions they would be much appreciated.

Thanks

Ben

 



-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com] 
Sent: 05 August 2009 14:36
To: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Hi Ben,

That's not only a wsdl problem, wsdl is just a contract between client  
and server, so even you change your wsdl on cxf bc provider side, your  
windows Visual studio server still hope a different incoming soap  
message (without namespace for soap header element).
One possible way as workaround is you add your interceptor(you may  
need take a look at org.apache.cxf.interceptor.LoggingOutInterceptor  
as example) for cxf bc outInterceptor, in this interceptor you hack  
the soap message before the message sent out, remove the namespace  
from soap header element, which is your windows Visual studio server  
expected.

Freeman
On 2009-8-5, at 下午7:07, Brown, Ben wrote:

> Hi Freeman
>
> Thanks for the reply; this at least makes it totally clear that my  
> problem is with the WSDL rather than in SM.
>
> Has anyone ever had to address this issue before and had to come up  
> with a workaround for invalid WSDL?  I know that one of the things  
> I'm going to find very hard to get changed is the WSDL - sadly this  
> might be another issue of Microsoft striking again...
>
> Thanks for all your help.
>
> Ben
>
>
>
>
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com]
> Sent: 05 August 2009 11:25
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
>
> Hi
>
> I go through the wsdl file you appended, the problem comes from the
> element SecretToken defined in one schema which has no
> targetNamespace, this isn't WS-I BP compliant, per WS-I Basic Profile
> 1.1[1],
> R2105  All xsd:schema elements contained in a wsdl:types element of a
> DESCRIPTION MUST have a targetNamespace attribute with a valid and  
> non-
> null value, UNLESS the xsd:schema element has xsd:import and/or
> xsd:annotation as its only child element(s).
> Follow the rules of WS-I BP can ensure webservice client/service from
> different party can communicate with each other.
> [1]http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLTYPES
> Freeman
>
> On 2009-8-5, at 下午4:38, Brown, Ben wrote:
>
>> Hi All
>>
>> I'm still battling with this, but I think I have just about
>> exhausted my knowledge on exploring the issue.
>>
>> As I said below I can make the WSDL validate - but actually this
>> makes the WSDL not function correctly, so the modifications are not
>> really correct.
>>
>> I can see now that the issue does occur with the SecretToken element:
>>
>> <xsd:schema elementFormDefault="qualified">
>>  <xsd:element name="SecretToken" nillable="true"
>> type="q3:SecretHeader"
>> 	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>> " />
>> </xsd:schema>
>>
>> This element has no namespace.  If I give it a namespace then the
>> document will parse, however if I do this the message is no longer
>> correctly formatted i.e. the no namespace is deliberate and  
>> necessary.
>>
>> This does parse correctly in SoapUI, so I believe that the issue
>> with Servicemix is not allowing this to parse - when the namespace
>> for this element is added to the list of elements in
>> ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no
>> URI and a temporary namespace prefix ns1 - however I believe that as
>> this has no URI it really shouldn't be added to the list of
>> namespaces?
>>
>> Things I know about the WSDL that may / may not be helpful.  The
>> WSDL is generated from Visual Studio (an external company we are
>> connecting to so no choice) automatically, which I why I believe it
>> is not as 'clean' as some of the example WSDL's that are seen.  This
>> may also explain the absence of namespace.
>>
>> I have attached a cut down version of the original WSDL, i.e.
>> removed all unused types and only left 1 operation.  If anyone has
>> time to have a quick look it would be much appreciated.
>>
>> Thanks
>>
>> Ben Brown
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Sent: 03 August 2009 13:30
>> To: users@servicemix.apache.org
>> Subject: RE: Error Parsing WSDL with CXF-BC
>>
>> Hi All
>>
>> An update on this issue.  I have now managed to get the CXF-BC
>> component to parse the WSDL by modifying a couple of parts of it.  I
>> have not as yet had time to work out the exact cause of this problem
>> in the SM code. The elements I had to change were as follows:
>>
>> <xsd:schema elementFormDefault="qualified">
>> 	<xsd:element name="SecretToken" nillable="true"
>> type="win:SecretHeader"/>
>> </xsd:schema>
>>
>> I had to move the namespace from this element and declare it on the
>> root node of the WSDL.  This also required adding the namespace to a
>> couple of nodes - same for the below two nodes:
>>
>> <wsdl:message
>> name
>> =
>> "ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage
>> ">
>> 	<wsdl:part name="detail" element="q5:DetailedFault"/>
>> </wsdl:message>
>>
>> <wsdl:message
>> name
>> ="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
>> 		<wsdl:part name="detail" element="q5:DetailedFault"/>
>> </wsdl:message>
>>
>> I will try to investigate the exact cause of this, but if anyone has
>> time to look that would be great.  I simply found out the
>> information above by debugging on the method shown in my previous
>> post, I have not as yet worked out where the namespace is read, and
>> why it does not try the local node to read the namespace from.
>>
>> Thanks
>>
>> Ben
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Sent: 31 July 2009 15:55
>> To: jb@nanthrax.net
>> Cc: users@servicemix.apache.org
>> Subject: RE: Error Parsing WSDL with CXF-BC
>>
>> Hi JB
>>
>> Sorry I didn't attach the deployment log before - I have attached
>> the full log - changed some of the URL's slightly.
>>
>> I have tracked things down further and the error actually seems to
>> occur on the SecretToken element of the WSDL:
>>
>> <xsd:schema elementFormDefault="qualified">
>>     <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>> " name="SecretToken" nillable="true" type="q3:SecretHeader"/>
>>   </xsd:schema>
>>
>> This appears to be the element where the namespace "ns1" with no URI
>> is inserted into the namespaces element of the WSDL Definition (in
>> ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).
>>
>> I don't think I have said this yet, but the reason I believe there
>> might be an issue in SM is that SoapUI can communicate with this web
>> service without error.
>>
>> If you need anything else please let me know.
>>
>> Ben
>>
>>
>>
>> -----Original Message-----
>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>> Sent: 31 July 2009 14:56
>> To: Brown, Ben
>> Cc: users@servicemix.apache.org
>> Subject: Re: Error Parsing WSDL with CXF-BC
>>
>> Hi Ben,
>>
>> correct, the load of the WSDL is made into the validate() method.  
>> It's
>> here that the component get the target WSDL, parse it and load.
>>
>> On my side, I have requested the target WSDL and the deployment debug
>> log, to try to load it (in a debugged unit test) and see why we have
>> an
>> error in the javax.xml loader.
>>
>> Could you provide both please ?
>>
>> Regards
>> JB
>>
>> Brown, Ben wrote:
>>> Thanks for the quick answers JB, Vivian
>>>
>>> I have been exploring a little further and digging into the code.
>>> It appears that the issue occurs during the validate method on
>>> CxfBcProvider, specifically on:
>>>
>>> description = WSDLFactory.newInstance().newWSDLWriter()
>>>                       .getDocument(swBuilder.build());
>>>
>>> It actually appears that during the build() method the Definition
>>> that is returned, the map of namespaces inside contains a namespace
>>> named ns1 but does not have a URI to go with that namespace.  This
>>> seems to be where the ns1 is coming from, and the reason it is
>>> blowing up.
>>>
>>> Looking at the WSDL (attached and company name removed), and then
>>> checking the namespaces with those in the map during debugging, it
>>> appears to be the http://schemas.microsoft.com/2003/10/
>>> Serialization/ namespace that is causing the issues.  My thoughts
>>> on why this might be the case are firstly that the xs namespace is
>>> only declared on the first xs element and NOT on the
>>> wsdl:definitions element and that possibly this is therefore not
>>> picked up by the code.
>>>
>>> Both of you asked about the actual messages sent, however this
>>> error is occurring during deployment of the component, and so I'm
>>> not actually sending a Soap message as yet, because the component
>>> won't deploy - so I'm doubting that it has anything to do with this.
>>>
>>> Please shout if you need any more information.
>>>
>>> Thanks
>>>
>>> Ben Brown
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>> Sent: 31 July 2009 13:33
>>> To: users@servicemix.apache.org
>>> Subject: Re: Error Parsing WSDL with CXF-BC
>>>
>>> Agreed Vivian,
>>>
>>> My comment was more concerning the ns1 namespace. It's not because
>>> the
>>> provided WSDL doesn't contain the namespace that it can't be
>>> present in
>>> the exposed one.
>>>
>>> The HTTP component especially can:
>>> - generate a WSDL using an abstract one (for example provided by the
>>> target endpoint). The abstract WSDL contains only type, message and
>>> port
>>> type. It doesn't contain binding. In this case, the component
>>> import the
>>> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the
>>> case
>>> in the soap-consumer endpoint when the target one define an abstract
>>> WSDL (as it's the case for the exec component). I began a work to  
>>> add
>>> abstract WSDL support in most of components.
>>> - take a WSDL and make cleanup on it. By cleanup, I mean that the
>>> HTTP
>>> component get the port type (the first one or the one corresponding
>>> to
>>> the service definition), delete all other port types, services,
>>> bindings
>>> and make a port type decoration. By port type decoration, I mean
>>> that it
>>> takes the original port type, the service name and construct the
>>> corresponding binding (it's done by PortTypeDecorator.decorate()
>>> method).
>>>
>>> I hope that I was clear :)
>>>
>>> Regards
>>> JB
>>>
>>> Madesclair Vivian wrote:
>>>> Well my understanding is still limited, but the CXF component only
>>>> add the SOAP wrapper right? So if the message, witch contains the
>>>> tag of the method to call use an invalid namespace, it might go
>>>> wrong. I didn't mean to say that the CXF sends a bad message, but
>>>> the incoming message in CXF (and therefore the output) might be
>>>> wrong.
>>>>
>>>> Or maybe I am. And btw what is port decoration?
>>>>
>>>> Regards,
>>>> Vivian
>>>>
>>>>
>>>> -----Message d'origine-----
>>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>>> Envoyé : vendredi 31 juillet 2009 14:09
>>>> À : users@servicemix.apache.org
>>>> Objet : Re: Error Parsing WSDL with CXF-BC
>>>>
>>>> No Vivian,
>>>>
>>>> HTTP and CXF-BC can use port decoration and so can add new binding
>>>> and namespace.
>>>>
>>>> Ben, could you provide the target WSDL (the one used by the
>>>> provider) and the SMX debug log file ? (I will check in the
>>>> component).
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> Madesclair Vivian wrote:
>>>>> Hi Ben
>>>>>
>>>>> If you wsdl doesnt contain a ns1 namespace, I guess the error  
>>>>> comes
>>>>> from the SOAP message that your CXF component is sending to your
>>>>> external service. Do you know the content of this message? (You  
>>>>> can
>>>>> activate debug mode of log4j if needed)
>>>>>
>>>>> If you still can't solve your problem, can you provide us with the
>>>>> content of the message and the wsdl? (you can attach the file)
>>>>>
>>>>> Regards
>>>>> Vivian
>>>>>
>>>>> -----Message d'origine-----
>>>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>>>> Envoyé : vendredi 31 juillet 2009 12:01 À :
>>>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>>>
>>>>> Hi All
>>>>>
>>>>>
>>>>>
>>>>> I am attempting to connect to an external web service using a CXF-
>>>>> BC provider.  On deployment of my service unit I am getting the
>>>>> following exception thrown:
>>>>>
>>>>>
>>>>>
>>>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>>>
>>>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
>>>>> Problem parsing '- WSDL Document -'.:
>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>> Prefixed namespace bindings may not be empty.
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>> 50
>>>>> 4)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache
>>>>> .servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>>>> java:58)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>>>> nD
>>>>> eployer.java:55)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>>>> ct
>>>>> XBeanDeployer.java:97)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>>>> ce
>>>>> UnitManager.java:88)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>>>> Un
>>>>> itManager.java:69)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.DeploymentService.deployServiceAss
>>>>> em
>>>>> bly(DeploymentService.java:520)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateServic
>>>>> eA
>>>>> ssembly(AutoDeploymentService.java:349)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>>>> e(
>>>>> AutoDeploymentService.java:255)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>>>> to
>>>>> ry(AutoDeploymentService.java:658)
>>>>>
>>>>>       at
>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access
>>>>> $800(A
>>>>> ut
>>>>> oDeploymentService.java:63)
>>>>>
>>>>>       at
>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService
>>>>> $1.run(AutoDe
>>>>> pl
>>>>> oymentService.java:622)
>>>>>
>>>>>       at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>>
>>>>>       at java.util.TimerThread.run(Timer.java:462)
>>>>>
>>>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>> Prefixed name
>>>>>
>>>>> space bindings may not be empty.
>>>>>
>>>>>       at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>> Source)
>>>>>
>>>>>       at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>> Source)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>> 47
>>>>> 4)
>>>>>
>>>>>       ... 13 more
>>>>>
>>>>> Caused by: org.xml.sax.SAXParseException: The value of the
>>>>> attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is
>>>>> invalid.
>>>>> Prefixed namespace bindings may not be empty.
>>>>>
>>>>>       at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>>>
>>>>>       at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>>>> Source)
>>>>>
>>>>>       ... 16 more
>>>>>
>>>>> ]]></stack-trace>
>>>>>
>>>>>
>>>>>
>>>>> I have found a few messages on the mailing list that have similar
>>>>> errors, however none seem to have any solutions - apologies if
>>>>> this is not the case I have tried to search for an answer.
>>>>>
>>>>>
>>>>>
>>>>> The WSDL that I am reading does not contain a namespace called
>>>>> ns1, so first question - is this an exception to do with parsing
>>>>> the external WSDL or something to do with an internally generated
>>>>> WSDL?
>>>>>
>>>>>
>>>>>
>>>>> In either case, does anyone have any clue as to how this can be
>>>>> solve, or the 'usual' causes for something like this.  I will
>>>>> probably be unable to post a link to the WSDL easily, however I
>>>>> can try to obfuscate out all identifying information if this
>>>>> would be useful to people.
>>>>>
>>>>>
>>>>>
>>>>> Incidentally, originally the WSDL contained a target namespace  
>>>>> of http://tempuri.org
>>>>> <http://tempuri.org/>  - but I had this changed as this appeared
>>>>> to cause errors where the target namespace did not match the
>>>>> actual namespace for the service.  At this stage the SA would
>>>>> deploy correctly with an error message, but no messages could be
>>>>> delivered as it had obviously not parsed the WSDL correctly.
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>>
>>>>>
>>>>> Ben Brown
>>>>>
>>>>> This email and any files or information it contains are
>>>>> confidential and may be privileged.  It is for the intended
>>>>> addressee(s) only.  The unauthorised use, disclosure or copying
>>>>> of this email or any information it contains, is prohibited and
>>>>> could, in certain circumstances be a criminal offence. If you are
>>>>> not the intended recipient you should not disseminate or copy
>>>>> this email.  Please notify the sender immediately and delete this
>>>>> message from your system.
>>>>>
>>>>> Please note that any opinions presented in this email are solely
>>>>> those of the author (or those of a third party whose statement is
>>>>> forwarded) and do not necessarily represent those of any company
>>>>> within the Bluefin Group Limited group of companies.
>>>>>
>>>>> Email transmission cannot be guaranteed to be secure or error
>>>>> free as information could be intercepted, corrupted, lost,
>>>>> destroyed, late in arriving or incomplete as a result of the
>>>>> transmission process.  The sender therefore does not accept
>>>>> liability for any errors or omissions in the contents of this
>>>>> message which arise as a result of email transmission.
>>>>>
>>>>> WARNING: Computer viruses can be transmitted by email. The
>>>>> recipient should check this email and any attachments for the
>>>>> presence of viruses.  The Bluefin Group Limited group of
>>>>> companies accepts no liability for any damage caused by any virus
>>>>> transmitted by this email.
>>>
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are
>>> confidential and may be privileged.  It is for the intended
>>> addressee(s) only.  The unauthorised use, disclosure or copying of
>>> this email or any information it contains, is prohibited and could,
>>> in certain circumstances be a criminal offence. If you are not the
>>> intended recipient you should not disseminate or copy this email.
>>> Please notify the sender immediately and delete this message from
>>> your system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as
>>> a result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The
>>> recipient should check this email and any attachments for the
>>> presence of viruses.  The Bluefin Group Limited group of companies
>>> accepts no liability for any damage caused by any virus transmitted
>>> by this email.
>>>
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>
>
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
>
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
>
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out

This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.


Re: Error Parsing WSDL with CXF-BC

Posted by Freeman Fang <fr...@gmail.com>.
Hi Ben,

That's not only a wsdl problem, wsdl is just a contract between client  
and server, so even you change your wsdl on cxf bc provider side, your  
windows Visual studio server still hope a different incoming soap  
message (without namespace for soap header element).
One possible way as workaround is you add your interceptor(you may  
need take a look at org.apache.cxf.interceptor.LoggingOutInterceptor  
as example) for cxf bc outInterceptor, in this interceptor you hack  
the soap message before the message sent out, remove the namespace  
from soap header element, which is your windows Visual studio server  
expected.

Freeman
On 2009-8-5, at 下午7:07, Brown, Ben wrote:

> Hi Freeman
>
> Thanks for the reply; this at least makes it totally clear that my  
> problem is with the WSDL rather than in SM.
>
> Has anyone ever had to address this issue before and had to come up  
> with a workaround for invalid WSDL?  I know that one of the things  
> I'm going to find very hard to get changed is the WSDL - sadly this  
> might be another issue of Microsoft striking again...
>
> Thanks for all your help.
>
> Ben
>
>
>
>
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com]
> Sent: 05 August 2009 11:25
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
>
> Hi
>
> I go through the wsdl file you appended, the problem comes from the
> element SecretToken defined in one schema which has no
> targetNamespace, this isn't WS-I BP compliant, per WS-I Basic Profile
> 1.1[1],
> R2105  All xsd:schema elements contained in a wsdl:types element of a
> DESCRIPTION MUST have a targetNamespace attribute with a valid and  
> non-
> null value, UNLESS the xsd:schema element has xsd:import and/or
> xsd:annotation as its only child element(s).
> Follow the rules of WS-I BP can ensure webservice client/service from
> different party can communicate with each other.
> [1]http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLTYPES
> Freeman
>
> On 2009-8-5, at 下午4:38, Brown, Ben wrote:
>
>> Hi All
>>
>> I'm still battling with this, but I think I have just about
>> exhausted my knowledge on exploring the issue.
>>
>> As I said below I can make the WSDL validate - but actually this
>> makes the WSDL not function correctly, so the modifications are not
>> really correct.
>>
>> I can see now that the issue does occur with the SecretToken element:
>>
>> <xsd:schema elementFormDefault="qualified">
>>  <xsd:element name="SecretToken" nillable="true"
>> type="q3:SecretHeader"
>> 	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>> " />
>> </xsd:schema>
>>
>> This element has no namespace.  If I give it a namespace then the
>> document will parse, however if I do this the message is no longer
>> correctly formatted i.e. the no namespace is deliberate and  
>> necessary.
>>
>> This does parse correctly in SoapUI, so I believe that the issue
>> with Servicemix is not allowing this to parse - when the namespace
>> for this element is added to the list of elements in
>> ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no
>> URI and a temporary namespace prefix ns1 - however I believe that as
>> this has no URI it really shouldn't be added to the list of
>> namespaces?
>>
>> Things I know about the WSDL that may / may not be helpful.  The
>> WSDL is generated from Visual Studio (an external company we are
>> connecting to so no choice) automatically, which I why I believe it
>> is not as 'clean' as some of the example WSDL's that are seen.  This
>> may also explain the absence of namespace.
>>
>> I have attached a cut down version of the original WSDL, i.e.
>> removed all unused types and only left 1 operation.  If anyone has
>> time to have a quick look it would be much appreciated.
>>
>> Thanks
>>
>> Ben Brown
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Sent: 03 August 2009 13:30
>> To: users@servicemix.apache.org
>> Subject: RE: Error Parsing WSDL with CXF-BC
>>
>> Hi All
>>
>> An update on this issue.  I have now managed to get the CXF-BC
>> component to parse the WSDL by modifying a couple of parts of it.  I
>> have not as yet had time to work out the exact cause of this problem
>> in the SM code. The elements I had to change were as follows:
>>
>> <xsd:schema elementFormDefault="qualified">
>> 	<xsd:element name="SecretToken" nillable="true"
>> type="win:SecretHeader"/>
>> </xsd:schema>
>>
>> I had to move the namespace from this element and declare it on the
>> root node of the WSDL.  This also required adding the namespace to a
>> couple of nodes - same for the below two nodes:
>>
>> <wsdl:message
>> name
>> =
>> "ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage
>> ">
>> 	<wsdl:part name="detail" element="q5:DetailedFault"/>
>> </wsdl:message>
>>
>> <wsdl:message
>> name
>> ="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
>> 		<wsdl:part name="detail" element="q5:DetailedFault"/>
>> </wsdl:message>
>>
>> I will try to investigate the exact cause of this, but if anyone has
>> time to look that would be great.  I simply found out the
>> information above by debugging on the method shown in my previous
>> post, I have not as yet worked out where the namespace is read, and
>> why it does not try the local node to read the namespace from.
>>
>> Thanks
>>
>> Ben
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Sent: 31 July 2009 15:55
>> To: jb@nanthrax.net
>> Cc: users@servicemix.apache.org
>> Subject: RE: Error Parsing WSDL with CXF-BC
>>
>> Hi JB
>>
>> Sorry I didn't attach the deployment log before - I have attached
>> the full log - changed some of the URL's slightly.
>>
>> I have tracked things down further and the error actually seems to
>> occur on the SecretToken element of the WSDL:
>>
>> <xsd:schema elementFormDefault="qualified">
>>     <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory
>> " name="SecretToken" nillable="true" type="q3:SecretHeader"/>
>>   </xsd:schema>
>>
>> This appears to be the element where the namespace "ns1" with no URI
>> is inserted into the namespaces element of the WSDL Definition (in
>> ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).
>>
>> I don't think I have said this yet, but the reason I believe there
>> might be an issue in SM is that SoapUI can communicate with this web
>> service without error.
>>
>> If you need anything else please let me know.
>>
>> Ben
>>
>>
>>
>> -----Original Message-----
>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>> Sent: 31 July 2009 14:56
>> To: Brown, Ben
>> Cc: users@servicemix.apache.org
>> Subject: Re: Error Parsing WSDL with CXF-BC
>>
>> Hi Ben,
>>
>> correct, the load of the WSDL is made into the validate() method.  
>> It's
>> here that the component get the target WSDL, parse it and load.
>>
>> On my side, I have requested the target WSDL and the deployment debug
>> log, to try to load it (in a debugged unit test) and see why we have
>> an
>> error in the javax.xml loader.
>>
>> Could you provide both please ?
>>
>> Regards
>> JB
>>
>> Brown, Ben wrote:
>>> Thanks for the quick answers JB, Vivian
>>>
>>> I have been exploring a little further and digging into the code.
>>> It appears that the issue occurs during the validate method on
>>> CxfBcProvider, specifically on:
>>>
>>> description = WSDLFactory.newInstance().newWSDLWriter()
>>>                       .getDocument(swBuilder.build());
>>>
>>> It actually appears that during the build() method the Definition
>>> that is returned, the map of namespaces inside contains a namespace
>>> named ns1 but does not have a URI to go with that namespace.  This
>>> seems to be where the ns1 is coming from, and the reason it is
>>> blowing up.
>>>
>>> Looking at the WSDL (attached and company name removed), and then
>>> checking the namespaces with those in the map during debugging, it
>>> appears to be the http://schemas.microsoft.com/2003/10/
>>> Serialization/ namespace that is causing the issues.  My thoughts
>>> on why this might be the case are firstly that the xs namespace is
>>> only declared on the first xs element and NOT on the
>>> wsdl:definitions element and that possibly this is therefore not
>>> picked up by the code.
>>>
>>> Both of you asked about the actual messages sent, however this
>>> error is occurring during deployment of the component, and so I'm
>>> not actually sending a Soap message as yet, because the component
>>> won't deploy - so I'm doubting that it has anything to do with this.
>>>
>>> Please shout if you need any more information.
>>>
>>> Thanks
>>>
>>> Ben Brown
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>> Sent: 31 July 2009 13:33
>>> To: users@servicemix.apache.org
>>> Subject: Re: Error Parsing WSDL with CXF-BC
>>>
>>> Agreed Vivian,
>>>
>>> My comment was more concerning the ns1 namespace. It's not because
>>> the
>>> provided WSDL doesn't contain the namespace that it can't be
>>> present in
>>> the exposed one.
>>>
>>> The HTTP component especially can:
>>> - generate a WSDL using an abstract one (for example provided by the
>>> target endpoint). The abstract WSDL contains only type, message and
>>> port
>>> type. It doesn't contain binding. In this case, the component
>>> import the
>>> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the
>>> case
>>> in the soap-consumer endpoint when the target one define an abstract
>>> WSDL (as it's the case for the exec component). I began a work to  
>>> add
>>> abstract WSDL support in most of components.
>>> - take a WSDL and make cleanup on it. By cleanup, I mean that the
>>> HTTP
>>> component get the port type (the first one or the one corresponding
>>> to
>>> the service definition), delete all other port types, services,
>>> bindings
>>> and make a port type decoration. By port type decoration, I mean
>>> that it
>>> takes the original port type, the service name and construct the
>>> corresponding binding (it's done by PortTypeDecorator.decorate()
>>> method).
>>>
>>> I hope that I was clear :)
>>>
>>> Regards
>>> JB
>>>
>>> Madesclair Vivian wrote:
>>>> Well my understanding is still limited, but the CXF component only
>>>> add the SOAP wrapper right? So if the message, witch contains the
>>>> tag of the method to call use an invalid namespace, it might go
>>>> wrong. I didn't mean to say that the CXF sends a bad message, but
>>>> the incoming message in CXF (and therefore the output) might be
>>>> wrong.
>>>>
>>>> Or maybe I am. And btw what is port decoration?
>>>>
>>>> Regards,
>>>> Vivian
>>>>
>>>>
>>>> -----Message d'origine-----
>>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>>> Envoyé : vendredi 31 juillet 2009 14:09
>>>> À : users@servicemix.apache.org
>>>> Objet : Re: Error Parsing WSDL with CXF-BC
>>>>
>>>> No Vivian,
>>>>
>>>> HTTP and CXF-BC can use port decoration and so can add new binding
>>>> and namespace.
>>>>
>>>> Ben, could you provide the target WSDL (the one used by the
>>>> provider) and the SMX debug log file ? (I will check in the
>>>> component).
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> Madesclair Vivian wrote:
>>>>> Hi Ben
>>>>>
>>>>> If you wsdl doesnt contain a ns1 namespace, I guess the error  
>>>>> comes
>>>>> from the SOAP message that your CXF component is sending to your
>>>>> external service. Do you know the content of this message? (You  
>>>>> can
>>>>> activate debug mode of log4j if needed)
>>>>>
>>>>> If you still can't solve your problem, can you provide us with the
>>>>> content of the message and the wsdl? (you can attach the file)
>>>>>
>>>>> Regards
>>>>> Vivian
>>>>>
>>>>> -----Message d'origine-----
>>>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>>>> Envoyé : vendredi 31 juillet 2009 12:01 À :
>>>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>>>
>>>>> Hi All
>>>>>
>>>>>
>>>>>
>>>>> I am attempting to connect to an external web service using a CXF-
>>>>> BC provider.  On deployment of my service unit I am getting the
>>>>> following exception thrown:
>>>>>
>>>>>
>>>>>
>>>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>>>
>>>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
>>>>> Problem parsing '- WSDL Document -'.:
>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>> Prefixed namespace bindings may not be empty.
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>> 50
>>>>> 4)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache
>>>>> .servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>>>> java:58)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>>>> nD
>>>>> eployer.java:55)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>>>> ct
>>>>> XBeanDeployer.java:97)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>>>> ce
>>>>> UnitManager.java:88)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>>>> Un
>>>>> itManager.java:69)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.DeploymentService.deployServiceAss
>>>>> em
>>>>> bly(DeploymentService.java:520)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateServic
>>>>> eA
>>>>> ssembly(AutoDeploymentService.java:349)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>>>> e(
>>>>> AutoDeploymentService.java:255)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>>>> to
>>>>> ry(AutoDeploymentService.java:658)
>>>>>
>>>>>       at
>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access
>>>>> $800(A
>>>>> ut
>>>>> oDeploymentService.java:63)
>>>>>
>>>>>       at
>>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService
>>>>> $1.run(AutoDe
>>>>> pl
>>>>> oymentService.java:622)
>>>>>
>>>>>       at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>>
>>>>>       at java.util.TimerThread.run(Timer.java:462)
>>>>>
>>>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>>> org.xml.sax.SAXParseException: The value of the attribute
>>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>>> Prefixed name
>>>>>
>>>>> space bindings may not be empty.
>>>>>
>>>>>       at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>> Source)
>>>>>
>>>>>       at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown
>>>>> Source)
>>>>>
>>>>>       at
>>>>> org
>>>>> .apache 
>>>>> .servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>>> 47
>>>>> 4)
>>>>>
>>>>>       ... 13 more
>>>>>
>>>>> Caused by: org.xml.sax.SAXParseException: The value of the
>>>>> attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is
>>>>> invalid.
>>>>> Prefixed namespace bindings may not be empty.
>>>>>
>>>>>       at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>>>
>>>>>       at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>>>> Source)
>>>>>
>>>>>       ... 16 more
>>>>>
>>>>> ]]></stack-trace>
>>>>>
>>>>>
>>>>>
>>>>> I have found a few messages on the mailing list that have similar
>>>>> errors, however none seem to have any solutions - apologies if
>>>>> this is not the case I have tried to search for an answer.
>>>>>
>>>>>
>>>>>
>>>>> The WSDL that I am reading does not contain a namespace called
>>>>> ns1, so first question - is this an exception to do with parsing
>>>>> the external WSDL or something to do with an internally generated
>>>>> WSDL?
>>>>>
>>>>>
>>>>>
>>>>> In either case, does anyone have any clue as to how this can be
>>>>> solve, or the 'usual' causes for something like this.  I will
>>>>> probably be unable to post a link to the WSDL easily, however I
>>>>> can try to obfuscate out all identifying information if this
>>>>> would be useful to people.
>>>>>
>>>>>
>>>>>
>>>>> Incidentally, originally the WSDL contained a target namespace  
>>>>> of http://tempuri.org
>>>>> <http://tempuri.org/>  - but I had this changed as this appeared
>>>>> to cause errors where the target namespace did not match the
>>>>> actual namespace for the service.  At this stage the SA would
>>>>> deploy correctly with an error message, but no messages could be
>>>>> delivered as it had obviously not parsed the WSDL correctly.
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>>
>>>>>
>>>>> Ben Brown
>>>>>
>>>>> This email and any files or information it contains are
>>>>> confidential and may be privileged.  It is for the intended
>>>>> addressee(s) only.  The unauthorised use, disclosure or copying
>>>>> of this email or any information it contains, is prohibited and
>>>>> could, in certain circumstances be a criminal offence. If you are
>>>>> not the intended recipient you should not disseminate or copy
>>>>> this email.  Please notify the sender immediately and delete this
>>>>> message from your system.
>>>>>
>>>>> Please note that any opinions presented in this email are solely
>>>>> those of the author (or those of a third party whose statement is
>>>>> forwarded) and do not necessarily represent those of any company
>>>>> within the Bluefin Group Limited group of companies.
>>>>>
>>>>> Email transmission cannot be guaranteed to be secure or error
>>>>> free as information could be intercepted, corrupted, lost,
>>>>> destroyed, late in arriving or incomplete as a result of the
>>>>> transmission process.  The sender therefore does not accept
>>>>> liability for any errors or omissions in the contents of this
>>>>> message which arise as a result of email transmission.
>>>>>
>>>>> WARNING: Computer viruses can be transmitted by email. The
>>>>> recipient should check this email and any attachments for the
>>>>> presence of viruses.  The Bluefin Group Limited group of
>>>>> companies accepts no liability for any damage caused by any virus
>>>>> transmitted by this email.
>>>
>>> --------------------------------------------------------------
>>> Protection | Management | Compliance - scanned for viruses and
>>> unwanted content by emailsystems
>>>
>>> Why use a managed email service? Click here to find out
>>> This email and any files or information it contains are
>>> confidential and may be privileged.  It is for the intended
>>> addressee(s) only.  The unauthorised use, disclosure or copying of
>>> this email or any information it contains, is prohibited and could,
>>> in certain circumstances be a criminal offence. If you are not the
>>> intended recipient you should not disseminate or copy this email.
>>> Please notify the sender immediately and delete this message from
>>> your system.
>>>
>>> Please note that any opinions presented in this email are solely
>>> those of the author (or those of a third party whose statement is
>>> forwarded) and do not necessarily represent those of any company
>>> within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free
>>> as information could be intercepted, corrupted, lost, destroyed,
>>> late in arriving or incomplete as a result of the transmission
>>> process.  The sender therefore does not accept liability for any
>>> errors or omissions in the contents of this message which arise as
>>> a result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The
>>> recipient should check this email and any attachments for the
>>> presence of viruses.  The Bluefin Group Limited group of companies
>>> accepts no liability for any damage caused by any virus transmitted
>>> by this email.
>>>
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are confidential
>> and may be privileged.  It is for the intended addressee(s) only.
>> The unauthorised use, disclosure or copying of this email or any
>> information it contains, is prohibited and could, in certain
>> circumstances be a criminal offence. If you are not the intended
>> recipient you should not disseminate or copy this email.  Please
>> notify the sender immediately and delete this message from your
>> system.
>>
>> Please note that any opinions presented in this email are solely
>> those of the author (or those of a third party whose statement is
>> forwarded) and do not necessarily represent those of any company
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free
>> as information could be intercepted, corrupted, lost, destroyed,
>> late in arriving or incomplete as a result of the transmission
>> process.  The sender therefore does not accept liability for any
>> errors or omissions in the contents of this message which arise as a
>> result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient
>> should check this email and any attachments for the presence of
>> viruses.  The Bluefin Group Limited group of companies accepts no
>> liability for any damage caused by any virus transmitted by this
>> email.
>
>
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
>
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
>
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Hi Freeman

Thanks for the reply; this at least makes it totally clear that my problem is with the WSDL rather than in SM.

Has anyone ever had to address this issue before and had to come up with a workaround for invalid WSDL?  I know that one of the things I'm going to find very hard to get changed is the WSDL - sadly this might be another issue of Microsoft striking again...

Thanks for all your help.

Ben

 



-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com] 
Sent: 05 August 2009 11:25
To: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Hi

I go through the wsdl file you appended, the problem comes from the  
element SecretToken defined in one schema which has no  
targetNamespace, this isn't WS-I BP compliant, per WS-I Basic Profile  
1.1[1],
R2105  All xsd:schema elements contained in a wsdl:types element of a  
DESCRIPTION MUST have a targetNamespace attribute with a valid and non- 
null value, UNLESS the xsd:schema element has xsd:import and/or  
xsd:annotation as its only child element(s).
Follow the rules of WS-I BP can ensure webservice client/service from  
different party can communicate with each other.
[1]http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLTYPES
Freeman

On 2009-8-5, at 下午4:38, Brown, Ben wrote:

> Hi All
>
> I'm still battling with this, but I think I have just about  
> exhausted my knowledge on exploring the issue.
>
> As I said below I can make the WSDL validate - but actually this  
> makes the WSDL not function correctly, so the modifications are not  
> really correct.
>
> I can see now that the issue does occur with the SecretToken element:
>
> <xsd:schema elementFormDefault="qualified">
>   <xsd:element name="SecretToken" nillable="true"  
> type="q3:SecretHeader"
> 	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory 
> " />
> </xsd:schema>
>
> This element has no namespace.  If I give it a namespace then the  
> document will parse, however if I do this the message is no longer  
> correctly formatted i.e. the no namespace is deliberate and necessary.
>
> This does parse correctly in SoapUI, so I believe that the issue  
> with Servicemix is not allowing this to parse - when the namespace  
> for this element is added to the list of elements in  
> ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no  
> URI and a temporary namespace prefix ns1 - however I believe that as  
> this has no URI it really shouldn't be added to the list of  
> namespaces?
>
> Things I know about the WSDL that may / may not be helpful.  The  
> WSDL is generated from Visual Studio (an external company we are  
> connecting to so no choice) automatically, which I why I believe it  
> is not as 'clean' as some of the example WSDL's that are seen.  This  
> may also explain the absence of namespace.
>
> I have attached a cut down version of the original WSDL, i.e.  
> removed all unused types and only left 1 operation.  If anyone has  
> time to have a quick look it would be much appreciated.
>
> Thanks
>
> Ben Brown
>
>
>
>
>
> -----Original Message-----
> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
> Sent: 03 August 2009 13:30
> To: users@servicemix.apache.org
> Subject: RE: Error Parsing WSDL with CXF-BC
>
> Hi All
>
> An update on this issue.  I have now managed to get the CXF-BC  
> component to parse the WSDL by modifying a couple of parts of it.  I  
> have not as yet had time to work out the exact cause of this problem  
> in the SM code. The elements I had to change were as follows:
>
> <xsd:schema elementFormDefault="qualified">
> 	<xsd:element name="SecretToken" nillable="true"  
> type="win:SecretHeader"/>
> </xsd:schema>
>
> I had to move the namespace from this element and declare it on the  
> root node of the WSDL.  This also required adding the namespace to a  
> couple of nodes - same for the below two nodes:
>
> <wsdl:message  
> name 
> = 
> "ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage 
> ">
> 	<wsdl:part name="detail" element="q5:DetailedFault"/>
> </wsdl:message>
>
> <wsdl:message
> name 
> ="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
> 		<wsdl:part name="detail" element="q5:DetailedFault"/>
> </wsdl:message>
>
> I will try to investigate the exact cause of this, but if anyone has  
> time to look that would be great.  I simply found out the  
> information above by debugging on the method shown in my previous  
> post, I have not as yet worked out where the namespace is read, and  
> why it does not try the local node to read the namespace from.
>
> Thanks
>
> Ben
>
>
>
>
>
>
> -----Original Message-----
> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
> Sent: 31 July 2009 15:55
> To: jb@nanthrax.net
> Cc: users@servicemix.apache.org
> Subject: RE: Error Parsing WSDL with CXF-BC
>
> Hi JB
>
> Sorry I didn't attach the deployment log before - I have attached  
> the full log - changed some of the URL's slightly.
>
> I have tracked things down further and the error actually seems to  
> occur on the SecretToken element of the WSDL:
>
> <xsd:schema elementFormDefault="qualified">
>      <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory 
> " name="SecretToken" nillable="true" type="q3:SecretHeader"/>
>    </xsd:schema>
>
> This appears to be the element where the namespace "ns1" with no URI  
> is inserted into the namespaces element of the WSDL Definition (in  
> ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).
>
> I don't think I have said this yet, but the reason I believe there  
> might be an issue in SM is that SoapUI can communicate with this web  
> service without error.
>
> If you need anything else please let me know.
>
> Ben
>
>
>
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Sent: 31 July 2009 14:56
> To: Brown, Ben
> Cc: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
>
> Hi Ben,
>
> correct, the load of the WSDL is made into the validate() method. It's
> here that the component get the target WSDL, parse it and load.
>
> On my side, I have requested the target WSDL and the deployment debug
> log, to try to load it (in a debugged unit test) and see why we have  
> an
> error in the javax.xml loader.
>
> Could you provide both please ?
>
> Regards
> JB
>
> Brown, Ben wrote:
>> Thanks for the quick answers JB, Vivian
>>
>> I have been exploring a little further and digging into the code.   
>> It appears that the issue occurs during the validate method on  
>> CxfBcProvider, specifically on:
>>
>> description = WSDLFactory.newInstance().newWSDLWriter()
>>                        .getDocument(swBuilder.build());
>>
>> It actually appears that during the build() method the Definition  
>> that is returned, the map of namespaces inside contains a namespace  
>> named ns1 but does not have a URI to go with that namespace.  This  
>> seems to be where the ns1 is coming from, and the reason it is  
>> blowing up.
>>
>> Looking at the WSDL (attached and company name removed), and then  
>> checking the namespaces with those in the map during debugging, it  
>> appears to be the http://schemas.microsoft.com/2003/10/ 
>> Serialization/ namespace that is causing the issues.  My thoughts  
>> on why this might be the case are firstly that the xs namespace is  
>> only declared on the first xs element and NOT on the  
>> wsdl:definitions element and that possibly this is therefore not  
>> picked up by the code.
>>
>> Both of you asked about the actual messages sent, however this  
>> error is occurring during deployment of the component, and so I'm  
>> not actually sending a Soap message as yet, because the component  
>> won't deploy - so I'm doubting that it has anything to do with this.
>>
>> Please shout if you need any more information.
>>
>> Thanks
>>
>> Ben Brown
>>
>>
>>
>> -----Original Message-----
>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>> Sent: 31 July 2009 13:33
>> To: users@servicemix.apache.org
>> Subject: Re: Error Parsing WSDL with CXF-BC
>>
>> Agreed Vivian,
>>
>> My comment was more concerning the ns1 namespace. It's not because  
>> the
>> provided WSDL doesn't contain the namespace that it can't be  
>> present in
>> the exposed one.
>>
>> The HTTP component especially can:
>> - generate a WSDL using an abstract one (for example provided by the
>> target endpoint). The abstract WSDL contains only type, message and  
>> port
>> type. It doesn't contain binding. In this case, the component  
>> import the
>> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the  
>> case
>> in the soap-consumer endpoint when the target one define an abstract
>> WSDL (as it's the case for the exec component). I began a work to add
>> abstract WSDL support in most of components.
>> - take a WSDL and make cleanup on it. By cleanup, I mean that the  
>> HTTP
>> component get the port type (the first one or the one corresponding  
>> to
>> the service definition), delete all other port types, services,  
>> bindings
>> and make a port type decoration. By port type decoration, I mean  
>> that it
>> takes the original port type, the service name and construct the
>> corresponding binding (it's done by PortTypeDecorator.decorate()  
>> method).
>>
>> I hope that I was clear :)
>>
>> Regards
>> JB
>>
>> Madesclair Vivian wrote:
>>> Well my understanding is still limited, but the CXF component only  
>>> add the SOAP wrapper right? So if the message, witch contains the  
>>> tag of the method to call use an invalid namespace, it might go  
>>> wrong. I didn't mean to say that the CXF sends a bad message, but  
>>> the incoming message in CXF (and therefore the output) might be  
>>> wrong.
>>>
>>> Or maybe I am. And btw what is port decoration?
>>>
>>> Regards,
>>> Vivian
>>>
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>> Envoyé : vendredi 31 juillet 2009 14:09
>>> À : users@servicemix.apache.org
>>> Objet : Re: Error Parsing WSDL with CXF-BC
>>>
>>> No Vivian,
>>>
>>> HTTP and CXF-BC can use port decoration and so can add new binding  
>>> and namespace.
>>>
>>> Ben, could you provide the target WSDL (the one used by the  
>>> provider) and the SMX debug log file ? (I will check in the  
>>> component).
>>>
>>> Regards
>>> JB
>>>
>>> Madesclair Vivian wrote:
>>>> Hi Ben
>>>>
>>>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes
>>>> from the SOAP message that your CXF component is sending to your
>>>> external service. Do you know the content of this message? (You can
>>>> activate debug mode of log4j if needed)
>>>>
>>>> If you still can't solve your problem, can you provide us with the
>>>> content of the message and the wsdl? (you can attach the file)
>>>>
>>>> Regards
>>>> Vivian
>>>>
>>>> -----Message d'origine-----
>>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>>> Envoyé : vendredi 31 juillet 2009 12:01 À :
>>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>>
>>>> Hi All
>>>>
>>>>
>>>>
>>>> I am attempting to connect to an external web service using a CXF- 
>>>> BC provider.  On deployment of my service unit I am getting the  
>>>> following exception thrown:
>>>>
>>>>
>>>>
>>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>> org.xml.sax.SAXParseException: The value of the attribute  
>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>>
>>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:  
>>>> Problem parsing '- WSDL Document -'.:  
>>>> org.xml.sax.SAXParseException: The value of the attribute  
>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.  
>>>> Prefixed namespace bindings may not be empty.
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>> 50
>>>> 4)
>>>>
>>>>        at
>>>> org 
>>>> .apache 
>>>> .servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>>> java:58)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>>> nD
>>>> eployer.java:55)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>>> ct
>>>> XBeanDeployer.java:97)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>>> ce
>>>> UnitManager.java:88)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>>> Un
>>>> itManager.java:69)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>>>> em
>>>> bly(DeploymentService.java:520)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>>>> eA
>>>> ssembly(AutoDeploymentService.java:349)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>>> e(
>>>> AutoDeploymentService.java:255)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>>> to
>>>> ry(AutoDeploymentService.java:658)
>>>>
>>>>        at
>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access 
>>>> $800(A
>>>> ut
>>>> oDeploymentService.java:63)
>>>>
>>>>        at
>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService 
>>>> $1.run(AutoDe
>>>> pl
>>>> oymentService.java:622)
>>>>
>>>>        at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>
>>>>        at java.util.TimerThread.run(Timer.java:462)
>>>>
>>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>> org.xml.sax.SAXParseException: The value of the attribute  
>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>> Prefixed name
>>>>
>>>> space bindings may not be empty.
>>>>
>>>>        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown  
>>>> Source)
>>>>
>>>>        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown  
>>>> Source)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>> 47
>>>> 4)
>>>>
>>>>        ... 13 more
>>>>
>>>> Caused by: org.xml.sax.SAXParseException: The value of the  
>>>> attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is  
>>>> invalid.
>>>> Prefixed namespace bindings may not be empty.
>>>>
>>>>        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>>
>>>>        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>>> Source)
>>>>
>>>>        ... 16 more
>>>>
>>>> ]]></stack-trace>
>>>>
>>>>
>>>>
>>>> I have found a few messages on the mailing list that have similar  
>>>> errors, however none seem to have any solutions - apologies if  
>>>> this is not the case I have tried to search for an answer.
>>>>
>>>>
>>>>
>>>> The WSDL that I am reading does not contain a namespace called  
>>>> ns1, so first question - is this an exception to do with parsing  
>>>> the external WSDL or something to do with an internally generated  
>>>> WSDL?
>>>>
>>>>
>>>>
>>>> In either case, does anyone have any clue as to how this can be  
>>>> solve, or the 'usual' causes for something like this.  I will  
>>>> probably be unable to post a link to the WSDL easily, however I  
>>>> can try to obfuscate out all identifying information if this  
>>>> would be useful to people.
>>>>
>>>>
>>>>
>>>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org 
>>>>  <http://tempuri.org/>  - but I had this changed as this appeared  
>>>> to cause errors where the target namespace did not match the  
>>>> actual namespace for the service.  At this stage the SA would  
>>>> deploy correctly with an error message, but no messages could be  
>>>> delivered as it had obviously not parsed the WSDL correctly.
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>> Ben Brown
>>>>
>>>> This email and any files or information it contains are  
>>>> confidential and may be privileged.  It is for the intended  
>>>> addressee(s) only.  The unauthorised use, disclosure or copying  
>>>> of this email or any information it contains, is prohibited and  
>>>> could, in certain circumstances be a criminal offence. If you are  
>>>> not the intended recipient you should not disseminate or copy  
>>>> this email.  Please notify the sender immediately and delete this  
>>>> message from your system.
>>>>
>>>> Please note that any opinions presented in this email are solely  
>>>> those of the author (or those of a third party whose statement is  
>>>> forwarded) and do not necessarily represent those of any company  
>>>> within the Bluefin Group Limited group of companies.
>>>>
>>>> Email transmission cannot be guaranteed to be secure or error  
>>>> free as information could be intercepted, corrupted, lost,  
>>>> destroyed, late in arriving or incomplete as a result of the  
>>>> transmission process.  The sender therefore does not accept  
>>>> liability for any errors or omissions in the contents of this  
>>>> message which arise as a result of email transmission.
>>>>
>>>> WARNING: Computer viruses can be transmitted by email. The  
>>>> recipient should check this email and any attachments for the  
>>>> presence of viruses.  The Bluefin Group Limited group of  
>>>> companies accepts no liability for any damage caused by any virus  
>>>> transmitted by this email.
>>
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and  
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are  
>> confidential and may be privileged.  It is for the intended  
>> addressee(s) only.  The unauthorised use, disclosure or copying of  
>> this email or any information it contains, is prohibited and could,  
>> in certain circumstances be a criminal offence. If you are not the  
>> intended recipient you should not disseminate or copy this email.   
>> Please notify the sender immediately and delete this message from  
>> your system.
>>
>> Please note that any opinions presented in this email are solely  
>> those of the author (or those of a third party whose statement is  
>> forwarded) and do not necessarily represent those of any company  
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free  
>> as information could be intercepted, corrupted, lost, destroyed,  
>> late in arriving or incomplete as a result of the transmission  
>> process.  The sender therefore does not accept liability for any  
>> errors or omissions in the contents of this message which arise as  
>> a result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The  
>> recipient should check this email and any attachments for the  
>> presence of viruses.  The Bluefin Group Limited group of companies  
>> accepts no liability for any damage caused by any virus transmitted  
>> by this email.
>>
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out

This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.


Re: Error Parsing WSDL with CXF-BC

Posted by Freeman Fang <fr...@gmail.com>.
Hi

I go through the wsdl file you appended, the problem comes from the  
element SecretToken defined in one schema which has no  
targetNamespace, this isn't WS-I BP compliant, per WS-I Basic Profile  
1.1[1],
R2105  All xsd:schema elements contained in a wsdl:types element of a  
DESCRIPTION MUST have a targetNamespace attribute with a valid and non- 
null value, UNLESS the xsd:schema element has xsd:import and/or  
xsd:annotation as its only child element(s).
Follow the rules of WS-I BP can ensure webservice client/service from  
different party can communicate with each other.
[1]http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLTYPES
Freeman

On 2009-8-5, at 下午4:38, Brown, Ben wrote:

> Hi All
>
> I'm still battling with this, but I think I have just about  
> exhausted my knowledge on exploring the issue.
>
> As I said below I can make the WSDL validate - but actually this  
> makes the WSDL not function correctly, so the modifications are not  
> really correct.
>
> I can see now that the issue does occur with the SecretToken element:
>
> <xsd:schema elementFormDefault="qualified">
>   <xsd:element name="SecretToken" nillable="true"  
> type="q3:SecretHeader"
> 	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory 
> " />
> </xsd:schema>
>
> This element has no namespace.  If I give it a namespace then the  
> document will parse, however if I do this the message is no longer  
> correctly formatted i.e. the no namespace is deliberate and necessary.
>
> This does parse correctly in SoapUI, so I believe that the issue  
> with Servicemix is not allowing this to parse - when the namespace  
> for this element is added to the list of elements in  
> ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no  
> URI and a temporary namespace prefix ns1 - however I believe that as  
> this has no URI it really shouldn't be added to the list of  
> namespaces?
>
> Things I know about the WSDL that may / may not be helpful.  The  
> WSDL is generated from Visual Studio (an external company we are  
> connecting to so no choice) automatically, which I why I believe it  
> is not as 'clean' as some of the example WSDL's that are seen.  This  
> may also explain the absence of namespace.
>
> I have attached a cut down version of the original WSDL, i.e.  
> removed all unused types and only left 1 operation.  If anyone has  
> time to have a quick look it would be much appreciated.
>
> Thanks
>
> Ben Brown
>
>
>
>
>
> -----Original Message-----
> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
> Sent: 03 August 2009 13:30
> To: users@servicemix.apache.org
> Subject: RE: Error Parsing WSDL with CXF-BC
>
> Hi All
>
> An update on this issue.  I have now managed to get the CXF-BC  
> component to parse the WSDL by modifying a couple of parts of it.  I  
> have not as yet had time to work out the exact cause of this problem  
> in the SM code. The elements I had to change were as follows:
>
> <xsd:schema elementFormDefault="qualified">
> 	<xsd:element name="SecretToken" nillable="true"  
> type="win:SecretHeader"/>
> </xsd:schema>
>
> I had to move the namespace from this element and declare it on the  
> root node of the WSDL.  This also required adding the namespace to a  
> couple of nodes - same for the below two nodes:
>
> <wsdl:message  
> name 
> = 
> "ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage 
> ">
> 	<wsdl:part name="detail" element="q5:DetailedFault"/>
> </wsdl:message>
>
> <wsdl:message
> name 
> ="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
> 		<wsdl:part name="detail" element="q5:DetailedFault"/>
> </wsdl:message>
>
> I will try to investigate the exact cause of this, but if anyone has  
> time to look that would be great.  I simply found out the  
> information above by debugging on the method shown in my previous  
> post, I have not as yet worked out where the namespace is read, and  
> why it does not try the local node to read the namespace from.
>
> Thanks
>
> Ben
>
>
>
>
>
>
> -----Original Message-----
> From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
> Sent: 31 July 2009 15:55
> To: jb@nanthrax.net
> Cc: users@servicemix.apache.org
> Subject: RE: Error Parsing WSDL with CXF-BC
>
> Hi JB
>
> Sorry I didn't attach the deployment log before - I have attached  
> the full log - changed some of the URL's slightly.
>
> I have tracked things down further and the error actually seems to  
> occur on the SecretToken element of the WSDL:
>
> <xsd:schema elementFormDefault="qualified">
>      <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory 
> " name="SecretToken" nillable="true" type="q3:SecretHeader"/>
>    </xsd:schema>
>
> This appears to be the element where the namespace "ns1" with no URI  
> is inserted into the namespaces element of the WSDL Definition (in  
> ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).
>
> I don't think I have said this yet, but the reason I believe there  
> might be an issue in SM is that SoapUI can communicate with this web  
> service without error.
>
> If you need anything else please let me know.
>
> Ben
>
>
>
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Sent: 31 July 2009 14:56
> To: Brown, Ben
> Cc: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
>
> Hi Ben,
>
> correct, the load of the WSDL is made into the validate() method. It's
> here that the component get the target WSDL, parse it and load.
>
> On my side, I have requested the target WSDL and the deployment debug
> log, to try to load it (in a debugged unit test) and see why we have  
> an
> error in the javax.xml loader.
>
> Could you provide both please ?
>
> Regards
> JB
>
> Brown, Ben wrote:
>> Thanks for the quick answers JB, Vivian
>>
>> I have been exploring a little further and digging into the code.   
>> It appears that the issue occurs during the validate method on  
>> CxfBcProvider, specifically on:
>>
>> description = WSDLFactory.newInstance().newWSDLWriter()
>>                        .getDocument(swBuilder.build());
>>
>> It actually appears that during the build() method the Definition  
>> that is returned, the map of namespaces inside contains a namespace  
>> named ns1 but does not have a URI to go with that namespace.  This  
>> seems to be where the ns1 is coming from, and the reason it is  
>> blowing up.
>>
>> Looking at the WSDL (attached and company name removed), and then  
>> checking the namespaces with those in the map during debugging, it  
>> appears to be the http://schemas.microsoft.com/2003/10/ 
>> Serialization/ namespace that is causing the issues.  My thoughts  
>> on why this might be the case are firstly that the xs namespace is  
>> only declared on the first xs element and NOT on the  
>> wsdl:definitions element and that possibly this is therefore not  
>> picked up by the code.
>>
>> Both of you asked about the actual messages sent, however this  
>> error is occurring during deployment of the component, and so I'm  
>> not actually sending a Soap message as yet, because the component  
>> won't deploy - so I'm doubting that it has anything to do with this.
>>
>> Please shout if you need any more information.
>>
>> Thanks
>>
>> Ben Brown
>>
>>
>>
>> -----Original Message-----
>> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>> Sent: 31 July 2009 13:33
>> To: users@servicemix.apache.org
>> Subject: Re: Error Parsing WSDL with CXF-BC
>>
>> Agreed Vivian,
>>
>> My comment was more concerning the ns1 namespace. It's not because  
>> the
>> provided WSDL doesn't contain the namespace that it can't be  
>> present in
>> the exposed one.
>>
>> The HTTP component especially can:
>> - generate a WSDL using an abstract one (for example provided by the
>> target endpoint). The abstract WSDL contains only type, message and  
>> port
>> type. It doesn't contain binding. In this case, the component  
>> import the
>> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the  
>> case
>> in the soap-consumer endpoint when the target one define an abstract
>> WSDL (as it's the case for the exec component). I began a work to add
>> abstract WSDL support in most of components.
>> - take a WSDL and make cleanup on it. By cleanup, I mean that the  
>> HTTP
>> component get the port type (the first one or the one corresponding  
>> to
>> the service definition), delete all other port types, services,  
>> bindings
>> and make a port type decoration. By port type decoration, I mean  
>> that it
>> takes the original port type, the service name and construct the
>> corresponding binding (it's done by PortTypeDecorator.decorate()  
>> method).
>>
>> I hope that I was clear :)
>>
>> Regards
>> JB
>>
>> Madesclair Vivian wrote:
>>> Well my understanding is still limited, but the CXF component only  
>>> add the SOAP wrapper right? So if the message, witch contains the  
>>> tag of the method to call use an invalid namespace, it might go  
>>> wrong. I didn't mean to say that the CXF sends a bad message, but  
>>> the incoming message in CXF (and therefore the output) might be  
>>> wrong.
>>>
>>> Or maybe I am. And btw what is port decoration?
>>>
>>> Regards,
>>> Vivian
>>>
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>>> Envoyé : vendredi 31 juillet 2009 14:09
>>> À : users@servicemix.apache.org
>>> Objet : Re: Error Parsing WSDL with CXF-BC
>>>
>>> No Vivian,
>>>
>>> HTTP and CXF-BC can use port decoration and so can add new binding  
>>> and namespace.
>>>
>>> Ben, could you provide the target WSDL (the one used by the  
>>> provider) and the SMX debug log file ? (I will check in the  
>>> component).
>>>
>>> Regards
>>> JB
>>>
>>> Madesclair Vivian wrote:
>>>> Hi Ben
>>>>
>>>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes
>>>> from the SOAP message that your CXF component is sending to your
>>>> external service. Do you know the content of this message? (You can
>>>> activate debug mode of log4j if needed)
>>>>
>>>> If you still can't solve your problem, can you provide us with the
>>>> content of the message and the wsdl? (you can attach the file)
>>>>
>>>> Regards
>>>> Vivian
>>>>
>>>> -----Message d'origine-----
>>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>>> Envoyé : vendredi 31 juillet 2009 12:01 À :
>>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>>
>>>> Hi All
>>>>
>>>>
>>>>
>>>> I am attempting to connect to an external web service using a CXF- 
>>>> BC provider.  On deployment of my service unit I am getting the  
>>>> following exception thrown:
>>>>
>>>>
>>>>
>>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>> org.xml.sax.SAXParseException: The value of the attribute  
>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>>
>>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:  
>>>> Problem parsing '- WSDL Document -'.:  
>>>> org.xml.sax.SAXParseException: The value of the attribute  
>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.  
>>>> Prefixed namespace bindings may not be empty.
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>> 50
>>>> 4)
>>>>
>>>>        at
>>>> org 
>>>> .apache 
>>>> .servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>>> java:58)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>>> nD
>>>> eployer.java:55)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>>> ct
>>>> XBeanDeployer.java:97)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>>> ce
>>>> UnitManager.java:88)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>>> Un
>>>> itManager.java:69)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>>>> em
>>>> bly(DeploymentService.java:520)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>>>> eA
>>>> ssembly(AutoDeploymentService.java:349)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>>> e(
>>>> AutoDeploymentService.java:255)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>>> to
>>>> ry(AutoDeploymentService.java:658)
>>>>
>>>>        at
>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access 
>>>> $800(A
>>>> ut
>>>> oDeploymentService.java:63)
>>>>
>>>>        at
>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService 
>>>> $1.run(AutoDe
>>>> pl
>>>> oymentService.java:622)
>>>>
>>>>        at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>
>>>>        at java.util.TimerThread.run(Timer.java:462)
>>>>
>>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>>> org.xml.sax.SAXParseException: The value of the attribute  
>>>> "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>>> Prefixed name
>>>>
>>>> space bindings may not be empty.
>>>>
>>>>        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown  
>>>> Source)
>>>>
>>>>        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown  
>>>> Source)
>>>>
>>>>        at
>>>> org 
>>>> .apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>>> 47
>>>> 4)
>>>>
>>>>        ... 13 more
>>>>
>>>> Caused by: org.xml.sax.SAXParseException: The value of the  
>>>> attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is  
>>>> invalid.
>>>> Prefixed namespace bindings may not be empty.
>>>>
>>>>        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>>
>>>>        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>>> Source)
>>>>
>>>>        ... 16 more
>>>>
>>>> ]]></stack-trace>
>>>>
>>>>
>>>>
>>>> I have found a few messages on the mailing list that have similar  
>>>> errors, however none seem to have any solutions - apologies if  
>>>> this is not the case I have tried to search for an answer.
>>>>
>>>>
>>>>
>>>> The WSDL that I am reading does not contain a namespace called  
>>>> ns1, so first question - is this an exception to do with parsing  
>>>> the external WSDL or something to do with an internally generated  
>>>> WSDL?
>>>>
>>>>
>>>>
>>>> In either case, does anyone have any clue as to how this can be  
>>>> solve, or the 'usual' causes for something like this.  I will  
>>>> probably be unable to post a link to the WSDL easily, however I  
>>>> can try to obfuscate out all identifying information if this  
>>>> would be useful to people.
>>>>
>>>>
>>>>
>>>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org 
>>>>  <http://tempuri.org/>  - but I had this changed as this appeared  
>>>> to cause errors where the target namespace did not match the  
>>>> actual namespace for the service.  At this stage the SA would  
>>>> deploy correctly with an error message, but no messages could be  
>>>> delivered as it had obviously not parsed the WSDL correctly.
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>> Ben Brown
>>>>
>>>> This email and any files or information it contains are  
>>>> confidential and may be privileged.  It is for the intended  
>>>> addressee(s) only.  The unauthorised use, disclosure or copying  
>>>> of this email or any information it contains, is prohibited and  
>>>> could, in certain circumstances be a criminal offence. If you are  
>>>> not the intended recipient you should not disseminate or copy  
>>>> this email.  Please notify the sender immediately and delete this  
>>>> message from your system.
>>>>
>>>> Please note that any opinions presented in this email are solely  
>>>> those of the author (or those of a third party whose statement is  
>>>> forwarded) and do not necessarily represent those of any company  
>>>> within the Bluefin Group Limited group of companies.
>>>>
>>>> Email transmission cannot be guaranteed to be secure or error  
>>>> free as information could be intercepted, corrupted, lost,  
>>>> destroyed, late in arriving or incomplete as a result of the  
>>>> transmission process.  The sender therefore does not accept  
>>>> liability for any errors or omissions in the contents of this  
>>>> message which arise as a result of email transmission.
>>>>
>>>> WARNING: Computer viruses can be transmitted by email. The  
>>>> recipient should check this email and any attachments for the  
>>>> presence of viruses.  The Bluefin Group Limited group of  
>>>> companies accepts no liability for any damage caused by any virus  
>>>> transmitted by this email.
>>
>> --------------------------------------------------------------
>> Protection | Management | Compliance - scanned for viruses and  
>> unwanted content by emailsystems
>>
>> Why use a managed email service? Click here to find out
>> This email and any files or information it contains are  
>> confidential and may be privileged.  It is for the intended  
>> addressee(s) only.  The unauthorised use, disclosure or copying of  
>> this email or any information it contains, is prohibited and could,  
>> in certain circumstances be a criminal offence. If you are not the  
>> intended recipient you should not disseminate or copy this email.   
>> Please notify the sender immediately and delete this message from  
>> your system.
>>
>> Please note that any opinions presented in this email are solely  
>> those of the author (or those of a third party whose statement is  
>> forwarded) and do not necessarily represent those of any company  
>> within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free  
>> as information could be intercepted, corrupted, lost, destroyed,  
>> late in arriving or incomplete as a result of the transmission  
>> process.  The sender therefore does not accept liability for any  
>> errors or omissions in the contents of this message which arise as  
>> a result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The  
>> recipient should check this email and any attachments for the  
>> presence of viruses.  The Bluefin Group Limited group of companies  
>> accepts no liability for any damage caused by any virus transmitted  
>> by this email.
>>
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and  
> unwanted content by emailsystems
>
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential  
> and may be privileged.  It is for the intended addressee(s) only.   
> The unauthorised use, disclosure or copying of this email or any  
> information it contains, is prohibited and could, in certain  
> circumstances be a criminal offence. If you are not the intended  
> recipient you should not disseminate or copy this email.  Please  
> notify the sender immediately and delete this message from your  
> system.
>
> Please note that any opinions presented in this email are solely  
> those of the author (or those of a third party whose statement is  
> forwarded) and do not necessarily represent those of any company  
> within the Bluefin Group Limited group of companies.
>
> Email transmission cannot be guaranteed to be secure or error free  
> as information could be intercepted, corrupted, lost, destroyed,  
> late in arriving or incomplete as a result of the transmission  
> process.  The sender therefore does not accept liability for any  
> errors or omissions in the contents of this message which arise as a  
> result of email transmission.
>
> WARNING: Computer viruses can be transmitted by email. The recipient  
> should check this email and any attachments for the presence of  
> viruses.  The Bluefin Group Limited group of companies accepts no  
> liability for any damage caused by any virus transmitted by this  
> email.


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Hi All

I'm still battling with this, but I think I have just about exhausted my knowledge on exploring the issue.

As I said below I can make the WSDL validate - but actually this makes the WSDL not function correctly, so the modifications are not really correct.  

I can see now that the issue does occur with the SecretToken element:

<xsd:schema elementFormDefault="qualified">
   <xsd:element name="SecretToken" nillable="true" type="q3:SecretHeader"
	xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory" />
</xsd:schema>

This element has no namespace.  If I give it a namespace then the document will parse, however if I do this the message is no longer correctly formatted i.e. the no namespace is deliberate and necessary.

This does parse correctly in SoapUI, so I believe that the issue with Servicemix is not allowing this to parse - when the namespace for this element is added to the list of elements in ServiceWSDLBuilder.buildMessage it adds a blank namespace i.e. no URI and a temporary namespace prefix ns1 - however I believe that as this has no URI it really shouldn't be added to the list of namespaces?

Things I know about the WSDL that may / may not be helpful.  The WSDL is generated from Visual Studio (an external company we are connecting to so no choice) automatically, which I why I believe it is not as 'clean' as some of the example WSDL's that are seen.  This may also explain the absence of namespace.

I have attached a cut down version of the original WSDL, i.e. removed all unused types and only left 1 operation.  If anyone has time to have a quick look it would be much appreciated. 

Thanks

Ben Brown

 



-----Original Message-----
From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk] 
Sent: 03 August 2009 13:30
To: users@servicemix.apache.org
Subject: RE: Error Parsing WSDL with CXF-BC

Hi All

An update on this issue.  I have now managed to get the CXF-BC component to parse the WSDL by modifying a couple of parts of it.  I have not as yet had time to work out the exact cause of this problem in the SM code. The elements I had to change were as follows:

<xsd:schema elementFormDefault="qualified">
	<xsd:element name="SecretToken" nillable="true" type="win:SecretHeader"/>
</xsd:schema>

I had to move the namespace from this element and declare it on the root node of the WSDL.  This also required adding the namespace to a couple of nodes - same for the below two nodes:

<wsdl:message name="ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage">
	<wsdl:part name="detail" element="q5:DetailedFault"/>
</wsdl:message>

<wsdl:message
 name="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
		<wsdl:part name="detail" element="q5:DetailedFault"/>
</wsdl:message>

I will try to investigate the exact cause of this, but if anyone has time to look that would be great.  I simply found out the information above by debugging on the method shown in my previous post, I have not as yet worked out where the namespace is read, and why it does not try the local node to read the namespace from.

Thanks

Ben



 


-----Original Message-----
From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk] 
Sent: 31 July 2009 15:55
To: jb@nanthrax.net
Cc: users@servicemix.apache.org
Subject: RE: Error Parsing WSDL with CXF-BC

Hi JB

Sorry I didn't attach the deployment log before - I have attached the full log - changed some of the URL's slightly.

I have tracked things down further and the error actually seems to occur on the SecretToken element of the WSDL:

<xsd:schema elementFormDefault="qualified">
      <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory" name="SecretToken" nillable="true" type="q3:SecretHeader"/>
    </xsd:schema>

This appears to be the element where the namespace "ns1" with no URI is inserted into the namespaces element of the WSDL Definition (in ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).

I don't think I have said this yet, but the reason I believe there might be an issue in SM is that SoapUI can communicate with this web service without error.

If you need anything else please let me know.

Ben



-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 31 July 2009 14:56
To: Brown, Ben
Cc: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Hi Ben,

correct, the load of the WSDL is made into the validate() method. It's 
here that the component get the target WSDL, parse it and load.

On my side, I have requested the target WSDL and the deployment debug 
log, to try to load it (in a debugged unit test) and see why we have an 
error in the javax.xml loader.

Could you provide both please ?

Regards
JB

Brown, Ben wrote:
> Thanks for the quick answers JB, Vivian
> 
> I have been exploring a little further and digging into the code.  It appears that the issue occurs during the validate method on CxfBcProvider, specifically on:
> 
> description = WSDLFactory.newInstance().newWSDLWriter()
>                         .getDocument(swBuilder.build());
> 
> It actually appears that during the build() method the Definition that is returned, the map of namespaces inside contains a namespace named ns1 but does not have a URI to go with that namespace.  This seems to be where the ns1 is coming from, and the reason it is blowing up.
> 
> Looking at the WSDL (attached and company name removed), and then checking the namespaces with those in the map during debugging, it appears to be the http://schemas.microsoft.com/2003/10/Serialization/ namespace that is causing the issues.  My thoughts on why this might be the case are firstly that the xs namespace is only declared on the first xs element and NOT on the wsdl:definitions element and that possibly this is therefore not picked up by the code.
> 
> Both of you asked about the actual messages sent, however this error is occurring during deployment of the component, and so I'm not actually sending a Soap message as yet, because the component won't deploy - so I'm doubting that it has anything to do with this.
> 
> Please shout if you need any more information.
> 
> Thanks
> 
> Ben Brown
> 
> 
> 
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Sent: 31 July 2009 13:33
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
> 
> Agreed Vivian,
> 
> My comment was more concerning the ns1 namespace. It's not because the 
> provided WSDL doesn't contain the namespace that it can't be present in 
> the exposed one.
> 
> The HTTP component especially can:
> - generate a WSDL using an abstract one (for example provided by the 
> target endpoint). The abstract WSDL contains only type, message and port 
> type. It doesn't contain binding. In this case, the component import the 
> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case 
> in the soap-consumer endpoint when the target one define an abstract 
> WSDL (as it's the case for the exec component). I began a work to add 
> abstract WSDL support in most of components.
> - take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP 
> component get the port type (the first one or the one corresponding to 
> the service definition), delete all other port types, services, bindings 
> and make a port type decoration. By port type decoration, I mean that it 
> takes the original port type, the service name and construct the 
> corresponding binding (it's done by PortTypeDecorator.decorate() method).
> 
> I hope that I was clear :)
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
>>
>> Or maybe I am. And btw what is port decoration?
>>
>> Regards,
>> Vivian
>>
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
>> Envoyé : vendredi 31 juillet 2009 14:09
>> À : users@servicemix.apache.org
>> Objet : Re: Error Parsing WSDL with CXF-BC
>>
>> No Vivian,
>>
>> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
>>
>> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
>>
>> Regards
>> JB
>>
>> Madesclair Vivian wrote:
>>> Hi Ben
>>>
>>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>>> from the SOAP message that your CXF component is sending to your 
>>> external service. Do you know the content of this message? (You can 
>>> activate debug mode of log4j if needed)
>>>
>>> If you still can't solve your problem, can you provide us with the 
>>> content of the message and the wsdl? (you can attach the file)
>>>
>>> Regards
>>> Vivian
>>>
>>> -----Message d'origine-----
>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>
>>> Hi All
>>>
>>>  
>>>
>>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>>
>>>  
>>>
>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>
>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 50
>>> 4)
>>>
>>>         at
>>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>> java:58)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>> nD
>>> eployer.java:55)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>> ct
>>> XBeanDeployer.java:97)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>> ce
>>> UnitManager.java:88)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>> Un
>>> itManager.java:69)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>>> em
>>> bly(DeploymentService.java:520)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>>> eA
>>> ssembly(AutoDeploymentService.java:349)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>> e(
>>> AutoDeploymentService.java:255)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>> to
>>> ry(AutoDeploymentService.java:658)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
>>> ut
>>> oDeploymentService.java:63)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
>>> pl
>>> oymentService.java:622)
>>>
>>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>>
>>>         at java.util.TimerThread.run(Timer.java:462)
>>>
>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed name
>>>
>>> space bindings may not be empty.
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 47
>>> 4)
>>>
>>>         ... 13 more
>>>
>>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.
>>>
>>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>
>>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>> Source)
>>>
>>>         ... 16 more
>>>
>>> ]]></stack-trace>
>>>
>>>  
>>>
>>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>>
>>>  
>>>
>>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>>
>>>  
>>>
>>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>>
>>>  
>>>
>>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>>
>>>  
>>>
>>> Thanks in advance.
>>>
>>>  
>>>
>>> Ben Brown
>>>
>>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>>
>>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems
> 
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
> 
> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
> 
> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
> 
> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Hi All

An update on this issue.  I have now managed to get the CXF-BC component to parse the WSDL by modifying a couple of parts of it.  I have not as yet had time to work out the exact cause of this problem in the SM code. The elements I had to change were as follows:

<xsd:schema elementFormDefault="qualified">
	<xsd:element name="SecretToken" nillable="true" type="win:SecretHeader"/>
</xsd:schema>

I had to move the namespace from this element and declare it on the root node of the WSDL.  This also required adding the namespace to a couple of nodes - same for the below two nodes:

<wsdl:message name="ICorporateOperations_SelectAllFundsAsList_DetailedFaultFault_FaultMessage">
	<wsdl:part name="detail" element="q5:DetailedFault"/>
</wsdl:message>

<wsdl:message
 name="ICorporateOperations_SelectFunds_DetailedFaultFault_FaultMessage">
		<wsdl:part name="detail" element="q5:DetailedFault"/>
</wsdl:message>

I will try to investigate the exact cause of this, but if anyone has time to look that would be great.  I simply found out the information above by debugging on the method shown in my previous post, I have not as yet worked out where the namespace is read, and why it does not try the local node to read the namespace from.

Thanks

Ben



 


-----Original Message-----
From: Brown, Ben [mailto:ben.brown@bluefingroup.co.uk] 
Sent: 31 July 2009 15:55
To: jb@nanthrax.net
Cc: users@servicemix.apache.org
Subject: RE: Error Parsing WSDL with CXF-BC

Hi JB

Sorry I didn't attach the deployment log before - I have attached the full log - changed some of the URL's slightly.

I have tracked things down further and the error actually seems to occur on the SecretToken element of the WSDL:

<xsd:schema elementFormDefault="qualified">
      <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory" name="SecretToken" nillable="true" type="q3:SecretHeader"/>
    </xsd:schema>

This appears to be the element where the namespace "ns1" with no URI is inserted into the namespaces element of the WSDL Definition (in ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).

I don't think I have said this yet, but the reason I believe there might be an issue in SM is that SoapUI can communicate with this web service without error.

If you need anything else please let me know.

Ben



-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 31 July 2009 14:56
To: Brown, Ben
Cc: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Hi Ben,

correct, the load of the WSDL is made into the validate() method. It's 
here that the component get the target WSDL, parse it and load.

On my side, I have requested the target WSDL and the deployment debug 
log, to try to load it (in a debugged unit test) and see why we have an 
error in the javax.xml loader.

Could you provide both please ?

Regards
JB

Brown, Ben wrote:
> Thanks for the quick answers JB, Vivian
> 
> I have been exploring a little further and digging into the code.  It appears that the issue occurs during the validate method on CxfBcProvider, specifically on:
> 
> description = WSDLFactory.newInstance().newWSDLWriter()
>                         .getDocument(swBuilder.build());
> 
> It actually appears that during the build() method the Definition that is returned, the map of namespaces inside contains a namespace named ns1 but does not have a URI to go with that namespace.  This seems to be where the ns1 is coming from, and the reason it is blowing up.
> 
> Looking at the WSDL (attached and company name removed), and then checking the namespaces with those in the map during debugging, it appears to be the http://schemas.microsoft.com/2003/10/Serialization/ namespace that is causing the issues.  My thoughts on why this might be the case are firstly that the xs namespace is only declared on the first xs element and NOT on the wsdl:definitions element and that possibly this is therefore not picked up by the code.
> 
> Both of you asked about the actual messages sent, however this error is occurring during deployment of the component, and so I'm not actually sending a Soap message as yet, because the component won't deploy - so I'm doubting that it has anything to do with this.
> 
> Please shout if you need any more information.
> 
> Thanks
> 
> Ben Brown
> 
> 
> 
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Sent: 31 July 2009 13:33
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
> 
> Agreed Vivian,
> 
> My comment was more concerning the ns1 namespace. It's not because the 
> provided WSDL doesn't contain the namespace that it can't be present in 
> the exposed one.
> 
> The HTTP component especially can:
> - generate a WSDL using an abstract one (for example provided by the 
> target endpoint). The abstract WSDL contains only type, message and port 
> type. It doesn't contain binding. In this case, the component import the 
> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case 
> in the soap-consumer endpoint when the target one define an abstract 
> WSDL (as it's the case for the exec component). I began a work to add 
> abstract WSDL support in most of components.
> - take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP 
> component get the port type (the first one or the one corresponding to 
> the service definition), delete all other port types, services, bindings 
> and make a port type decoration. By port type decoration, I mean that it 
> takes the original port type, the service name and construct the 
> corresponding binding (it's done by PortTypeDecorator.decorate() method).
> 
> I hope that I was clear :)
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
>>
>> Or maybe I am. And btw what is port decoration?
>>
>> Regards,
>> Vivian
>>
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
>> Envoyé : vendredi 31 juillet 2009 14:09
>> À : users@servicemix.apache.org
>> Objet : Re: Error Parsing WSDL with CXF-BC
>>
>> No Vivian,
>>
>> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
>>
>> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
>>
>> Regards
>> JB
>>
>> Madesclair Vivian wrote:
>>> Hi Ben
>>>
>>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>>> from the SOAP message that your CXF component is sending to your 
>>> external service. Do you know the content of this message? (You can 
>>> activate debug mode of log4j if needed)
>>>
>>> If you still can't solve your problem, can you provide us with the 
>>> content of the message and the wsdl? (you can attach the file)
>>>
>>> Regards
>>> Vivian
>>>
>>> -----Message d'origine-----
>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>
>>> Hi All
>>>
>>>  
>>>
>>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>>
>>>  
>>>
>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>
>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 50
>>> 4)
>>>
>>>         at
>>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>> java:58)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>> nD
>>> eployer.java:55)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>> ct
>>> XBeanDeployer.java:97)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>> ce
>>> UnitManager.java:88)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>> Un
>>> itManager.java:69)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>>> em
>>> bly(DeploymentService.java:520)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>>> eA
>>> ssembly(AutoDeploymentService.java:349)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>> e(
>>> AutoDeploymentService.java:255)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>> to
>>> ry(AutoDeploymentService.java:658)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
>>> ut
>>> oDeploymentService.java:63)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
>>> pl
>>> oymentService.java:622)
>>>
>>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>>
>>>         at java.util.TimerThread.run(Timer.java:462)
>>>
>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed name
>>>
>>> space bindings may not be empty.
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 47
>>> 4)
>>>
>>>         ... 13 more
>>>
>>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.
>>>
>>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>
>>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>> Source)
>>>
>>>         ... 16 more
>>>
>>> ]]></stack-trace>
>>>
>>>  
>>>
>>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>>
>>>  
>>>
>>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>>
>>>  
>>>
>>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>>
>>>  
>>>
>>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>>
>>>  
>>>
>>> Thanks in advance.
>>>
>>>  
>>>
>>> Ben Brown
>>>
>>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>>
>>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems
> 
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
> 
> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
> 
> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
> 
> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Hi JB

Sorry I didn't attach the deployment log before - I have attached the full log - changed some of the URL's slightly.

I have tracked things down further and the error actually seems to occur on the SecretToken element of the WSDL:

<xsd:schema elementFormDefault="qualified">
      <xsd:element xmlns:q3="http://schemas.datacontract.org/2004/07/Winterthur.SoapHeaderFactory" name="SecretToken" nillable="true" type="q3:SecretHeader"/>
    </xsd:schema>

This appears to be the element where the namespace "ns1" with no URI is inserted into the namespaces element of the WSDL Definition (in ServiceWsdlBuilder.buildMessage(message, messageContainer, def)).

I don't think I have said this yet, but the reason I believe there might be an issue in SM is that SoapUI can communicate with this web service without error.

If you need anything else please let me know.

Ben



-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 31 July 2009 14:56
To: Brown, Ben
Cc: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Hi Ben,

correct, the load of the WSDL is made into the validate() method. It's 
here that the component get the target WSDL, parse it and load.

On my side, I have requested the target WSDL and the deployment debug 
log, to try to load it (in a debugged unit test) and see why we have an 
error in the javax.xml loader.

Could you provide both please ?

Regards
JB

Brown, Ben wrote:
> Thanks for the quick answers JB, Vivian
> 
> I have been exploring a little further and digging into the code.  It appears that the issue occurs during the validate method on CxfBcProvider, specifically on:
> 
> description = WSDLFactory.newInstance().newWSDLWriter()
>                         .getDocument(swBuilder.build());
> 
> It actually appears that during the build() method the Definition that is returned, the map of namespaces inside contains a namespace named ns1 but does not have a URI to go with that namespace.  This seems to be where the ns1 is coming from, and the reason it is blowing up.
> 
> Looking at the WSDL (attached and company name removed), and then checking the namespaces with those in the map during debugging, it appears to be the http://schemas.microsoft.com/2003/10/Serialization/ namespace that is causing the issues.  My thoughts on why this might be the case are firstly that the xs namespace is only declared on the first xs element and NOT on the wsdl:definitions element and that possibly this is therefore not picked up by the code.
> 
> Both of you asked about the actual messages sent, however this error is occurring during deployment of the component, and so I'm not actually sending a Soap message as yet, because the component won't deploy - so I'm doubting that it has anything to do with this.
> 
> Please shout if you need any more information.
> 
> Thanks
> 
> Ben Brown
> 
> 
> 
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Sent: 31 July 2009 13:33
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
> 
> Agreed Vivian,
> 
> My comment was more concerning the ns1 namespace. It's not because the 
> provided WSDL doesn't contain the namespace that it can't be present in 
> the exposed one.
> 
> The HTTP component especially can:
> - generate a WSDL using an abstract one (for example provided by the 
> target endpoint). The abstract WSDL contains only type, message and port 
> type. It doesn't contain binding. In this case, the component import the 
> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case 
> in the soap-consumer endpoint when the target one define an abstract 
> WSDL (as it's the case for the exec component). I began a work to add 
> abstract WSDL support in most of components.
> - take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP 
> component get the port type (the first one or the one corresponding to 
> the service definition), delete all other port types, services, bindings 
> and make a port type decoration. By port type decoration, I mean that it 
> takes the original port type, the service name and construct the 
> corresponding binding (it's done by PortTypeDecorator.decorate() method).
> 
> I hope that I was clear :)
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
>>
>> Or maybe I am. And btw what is port decoration?
>>
>> Regards,
>> Vivian
>>
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
>> Envoyé : vendredi 31 juillet 2009 14:09
>> À : users@servicemix.apache.org
>> Objet : Re: Error Parsing WSDL with CXF-BC
>>
>> No Vivian,
>>
>> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
>>
>> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
>>
>> Regards
>> JB
>>
>> Madesclair Vivian wrote:
>>> Hi Ben
>>>
>>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>>> from the SOAP message that your CXF component is sending to your 
>>> external service. Do you know the content of this message? (You can 
>>> activate debug mode of log4j if needed)
>>>
>>> If you still can't solve your problem, can you provide us with the 
>>> content of the message and the wsdl? (you can attach the file)
>>>
>>> Regards
>>> Vivian
>>>
>>> -----Message d'origine-----
>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>
>>> Hi All
>>>
>>>  
>>>
>>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>>
>>>  
>>>
>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>
>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 50
>>> 4)
>>>
>>>         at
>>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>> java:58)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>> nD
>>> eployer.java:55)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>> ct
>>> XBeanDeployer.java:97)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>> ce
>>> UnitManager.java:88)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>> Un
>>> itManager.java:69)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>>> em
>>> bly(DeploymentService.java:520)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>>> eA
>>> ssembly(AutoDeploymentService.java:349)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>> e(
>>> AutoDeploymentService.java:255)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>> to
>>> ry(AutoDeploymentService.java:658)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
>>> ut
>>> oDeploymentService.java:63)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
>>> pl
>>> oymentService.java:622)
>>>
>>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>>
>>>         at java.util.TimerThread.run(Timer.java:462)
>>>
>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed name
>>>
>>> space bindings may not be empty.
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 47
>>> 4)
>>>
>>>         ... 13 more
>>>
>>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.
>>>
>>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>
>>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>> Source)
>>>
>>>         ... 16 more
>>>
>>> ]]></stack-trace>
>>>
>>>  
>>>
>>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>>
>>>  
>>>
>>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>>
>>>  
>>>
>>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>>
>>>  
>>>
>>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>>
>>>  
>>>
>>> Thanks in advance.
>>>
>>>  
>>>
>>> Ben Brown
>>>
>>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>>
>>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems
> 
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
> 
> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
> 
> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
> 
> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

Re: Error Parsing WSDL with CXF-BC

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Ben,

correct, the load of the WSDL is made into the validate() method. It's 
here that the component get the target WSDL, parse it and load.

On my side, I have requested the target WSDL and the deployment debug 
log, to try to load it (in a debugged unit test) and see why we have an 
error in the javax.xml loader.

Could you provide both please ?

Regards
JB

Brown, Ben wrote:
> Thanks for the quick answers JB, Vivian
> 
> I have been exploring a little further and digging into the code.  It appears that the issue occurs during the validate method on CxfBcProvider, specifically on:
> 
> description = WSDLFactory.newInstance().newWSDLWriter()
>                         .getDocument(swBuilder.build());
> 
> It actually appears that during the build() method the Definition that is returned, the map of namespaces inside contains a namespace named ns1 but does not have a URI to go with that namespace.  This seems to be where the ns1 is coming from, and the reason it is blowing up.
> 
> Looking at the WSDL (attached and company name removed), and then checking the namespaces with those in the map during debugging, it appears to be the http://schemas.microsoft.com/2003/10/Serialization/ namespace that is causing the issues.  My thoughts on why this might be the case are firstly that the xs namespace is only declared on the first xs element and NOT on the wsdl:definitions element and that possibly this is therefore not picked up by the code.
> 
> Both of you asked about the actual messages sent, however this error is occurring during deployment of the component, and so I'm not actually sending a Soap message as yet, because the component won't deploy - so I'm doubting that it has anything to do with this.
> 
> Please shout if you need any more information.
> 
> Thanks
> 
> Ben Brown
> 
> 
> 
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Sent: 31 July 2009 13:33
> To: users@servicemix.apache.org
> Subject: Re: Error Parsing WSDL with CXF-BC
> 
> Agreed Vivian,
> 
> My comment was more concerning the ns1 namespace. It's not because the 
> provided WSDL doesn't contain the namespace that it can't be present in 
> the exposed one.
> 
> The HTTP component especially can:
> - generate a WSDL using an abstract one (for example provided by the 
> target endpoint). The abstract WSDL contains only type, message and port 
> type. It doesn't contain binding. In this case, the component import the 
> abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case 
> in the soap-consumer endpoint when the target one define an abstract 
> WSDL (as it's the case for the exec component). I began a work to add 
> abstract WSDL support in most of components.
> - take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP 
> component get the port type (the first one or the one corresponding to 
> the service definition), delete all other port types, services, bindings 
> and make a port type decoration. By port type decoration, I mean that it 
> takes the original port type, the service name and construct the 
> corresponding binding (it's done by PortTypeDecorator.decorate() method).
> 
> I hope that I was clear :)
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
>>
>> Or maybe I am. And btw what is port decoration?
>>
>> Regards,
>> Vivian
>>
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
>> Envoyé : vendredi 31 juillet 2009 14:09
>> À : users@servicemix.apache.org
>> Objet : Re: Error Parsing WSDL with CXF-BC
>>
>> No Vivian,
>>
>> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
>>
>> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
>>
>> Regards
>> JB
>>
>> Madesclair Vivian wrote:
>>> Hi Ben
>>>
>>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>>> from the SOAP message that your CXF component is sending to your 
>>> external service. Do you know the content of this message? (You can 
>>> activate debug mode of log4j if needed)
>>>
>>> If you still can't solve your problem, can you provide us with the 
>>> content of the message and the wsdl? (you can attach the file)
>>>
>>> Regards
>>> Vivian
>>>
>>> -----Message d'origine-----
>>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>>
>>> Hi All
>>>
>>>  
>>>
>>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>>
>>>  
>>>
>>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.</loc-message>
>>>
>>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 50
>>> 4)
>>>
>>>         at
>>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>>> java:58)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>>> nD
>>> eployer.java:55)
>>>
>>>         at
>>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>>> ct
>>> XBeanDeployer.java:97)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>>> ce
>>> UnitManager.java:88)
>>>
>>>         at
>>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>>> Un
>>> itManager.java:69)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>>> em
>>> bly(DeploymentService.java:520)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>>> eA
>>> ssembly(AutoDeploymentService.java:349)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>>> e(
>>> AutoDeploymentService.java:255)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>>> to
>>> ry(AutoDeploymentService.java:658)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
>>> ut
>>> oDeploymentService.java:63)
>>>
>>>         at
>>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
>>> pl
>>> oymentService.java:622)
>>>
>>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>>
>>>         at java.util.TimerThread.run(Timer.java:462)
>>>
>>> Caused by: javax.wsdl.WSDLException: WSDLException:
>>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed name
>>>
>>> space bindings may not be empty.
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>
>>>         at
>>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>>> 47
>>> 4)
>>>
>>>         ... 13 more
>>>
>>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>>> Prefixed namespace bindings may not be empty.
>>>
>>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>>
>>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>>> Source)
>>>
>>>         ... 16 more
>>>
>>> ]]></stack-trace>
>>>
>>>  
>>>
>>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>>
>>>  
>>>
>>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>>
>>>  
>>>
>>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>>
>>>  
>>>
>>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>>
>>>  
>>>
>>> Thanks in advance.
>>>
>>>  
>>>
>>> Ben Brown
>>>
>>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>>
>>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>>
>>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 
> --------------------------------------------------------------
> Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems
> 
> Why use a managed email service? Click here to find out
> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
> 
> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
> 
> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
> 
> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.
> 

RE: Error Parsing WSDL with CXF-BC

Posted by "Brown, Ben" <be...@bluefingroup.co.uk>.
Thanks for the quick answers JB, Vivian

I have been exploring a little further and digging into the code.  It appears that the issue occurs during the validate method on CxfBcProvider, specifically on:

description = WSDLFactory.newInstance().newWSDLWriter()
                        .getDocument(swBuilder.build());

It actually appears that during the build() method the Definition that is returned, the map of namespaces inside contains a namespace named ns1 but does not have a URI to go with that namespace.  This seems to be where the ns1 is coming from, and the reason it is blowing up.

Looking at the WSDL (attached and company name removed), and then checking the namespaces with those in the map during debugging, it appears to be the http://schemas.microsoft.com/2003/10/Serialization/ namespace that is causing the issues.  My thoughts on why this might be the case are firstly that the xs namespace is only declared on the first xs element and NOT on the wsdl:definitions element and that possibly this is therefore not picked up by the code.

Both of you asked about the actual messages sent, however this error is occurring during deployment of the component, and so I'm not actually sending a Soap message as yet, because the component won't deploy - so I'm doubting that it has anything to do with this.

Please shout if you need any more information.

Thanks

Ben Brown



-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 31 July 2009 13:33
To: users@servicemix.apache.org
Subject: Re: Error Parsing WSDL with CXF-BC

Agreed Vivian,

My comment was more concerning the ns1 namespace. It's not because the 
provided WSDL doesn't contain the namespace that it can't be present in 
the exposed one.

The HTTP component especially can:
- generate a WSDL using an abstract one (for example provided by the 
target endpoint). The abstract WSDL contains only type, message and port 
type. It doesn't contain binding. In this case, the component import the 
abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case 
in the soap-consumer endpoint when the target one define an abstract 
WSDL (as it's the case for the exec component). I began a work to add 
abstract WSDL support in most of components.
- take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP 
component get the port type (the first one or the one corresponding to 
the service definition), delete all other port types, services, bindings 
and make a port type decoration. By port type decoration, I mean that it 
takes the original port type, the service name and construct the 
corresponding binding (it's done by PortTypeDecorator.decorate() method).

I hope that I was clear :)

Regards
JB

Madesclair Vivian wrote:
> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
> 
> Or maybe I am. And btw what is port decoration?
> 
> Regards,
> Vivian
> 
> 
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Envoyé : vendredi 31 juillet 2009 14:09
> À : users@servicemix.apache.org
> Objet : Re: Error Parsing WSDL with CXF-BC
> 
> No Vivian,
> 
> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
> 
> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Hi Ben
>>
>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>> from the SOAP message that your CXF component is sending to your 
>> external service. Do you know the content of this message? (You can 
>> activate debug mode of log4j if needed)
>>
>> If you still can't solve your problem, can you provide us with the 
>> content of the message and the wsdl? (you can attach the file)
>>
>> Regards
>> Vivian
>>
>> -----Message d'origine-----
>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>
>> Hi All
>>
>>  
>>
>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>
>>  
>>
>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed namespace bindings may not be empty.</loc-message>
>>
>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>
>>         at
>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>> 50
>> 4)
>>
>>         at
>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>> java:58)
>>
>>         at
>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>> nD
>> eployer.java:55)
>>
>>         at
>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>> ct
>> XBeanDeployer.java:97)
>>
>>         at
>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>> ce
>> UnitManager.java:88)
>>
>>         at
>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>> Un
>> itManager.java:69)
>>
>>         at
>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>> em
>> bly(DeploymentService.java:520)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>> eA
>> ssembly(AutoDeploymentService.java:349)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>> e(
>> AutoDeploymentService.java:255)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>> to
>> ry(AutoDeploymentService.java:658)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
>> ut
>> oDeploymentService.java:63)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
>> pl
>> oymentService.java:622)
>>
>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>
>>         at java.util.TimerThread.run(Timer.java:462)
>>
>> Caused by: javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed name
>>
>> space bindings may not be empty.
>>
>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>
>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>
>>         at
>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>> 47
>> 4)
>>
>>         ... 13 more
>>
>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed namespace bindings may not be empty.
>>
>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>
>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>> Source)
>>
>>         ... 16 more
>>
>> ]]></stack-trace>
>>
>>  
>>
>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>
>>  
>>
>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>
>>  
>>
>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>
>>  
>>
>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>
>>  
>>
>> Thanks in advance.
>>
>>  
>>
>> Ben Brown
>>
>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>
>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

Re: Error Parsing WSDL with CXF-BC

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Agreed Vivian,

My comment was more concerning the ns1 namespace. It's not because the 
provided WSDL doesn't contain the namespace that it can't be present in 
the exposed one.

The HTTP component especially can:
- generate a WSDL using an abstract one (for example provided by the 
target endpoint). The abstract WSDL contains only type, message and port 
type. It doesn't contain binding. In this case, the component import the 
abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case 
in the soap-consumer endpoint when the target one define an abstract 
WSDL (as it's the case for the exec component). I began a work to add 
abstract WSDL support in most of components.
- take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP 
component get the port type (the first one or the one corresponding to 
the service definition), delete all other port types, services, bindings 
and make a port type decoration. By port type decoration, I mean that it 
takes the original port type, the service name and construct the 
corresponding binding (it's done by PortTypeDecorator.decorate() method).

I hope that I was clear :)

Regards
JB

Madesclair Vivian wrote:
> Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.
> 
> Or maybe I am. And btw what is port decoration?
> 
> Regards,
> Vivian
> 
> 
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Envoyé : vendredi 31 juillet 2009 14:09
> À : users@servicemix.apache.org
> Objet : Re: Error Parsing WSDL with CXF-BC
> 
> No Vivian,
> 
> HTTP and CXF-BC can use port decoration and so can add new binding and namespace.
> 
> Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).
> 
> Regards
> JB
> 
> Madesclair Vivian wrote:
>> Hi Ben
>>
>> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
>> from the SOAP message that your CXF component is sending to your 
>> external service. Do you know the content of this message? (You can 
>> activate debug mode of log4j if needed)
>>
>> If you still can't solve your problem, can you provide us with the 
>> content of the message and the wsdl? (you can attach the file)
>>
>> Regards
>> Vivian
>>
>> -----Message d'origine-----
>> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
>> Envoyé : vendredi 31 juillet 2009 12:01 À : 
>> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
>>
>> Hi All
>>
>>  
>>
>> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
>>
>>  
>>
>> <loc-message>javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed namespace bindings may not be empty.</loc-message>
>>
>> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
>>
>>         at
>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>> 50
>> 4)
>>
>>         at
>> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
>> java:58)
>>
>>         at
>> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
>> nD
>> eployer.java:55)
>>
>>         at
>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
>> ct
>> XBeanDeployer.java:97)
>>
>>         at
>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
>> ce
>> UnitManager.java:88)
>>
>>         at
>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
>> Un
>> itManager.java:69)
>>
>>         at
>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
>> em
>> bly(DeploymentService.java:520)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
>> eA
>> ssembly(AutoDeploymentService.java:349)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
>> e(
>> AutoDeploymentService.java:255)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
>> to
>> ry(AutoDeploymentService.java:658)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
>> ut
>> oDeploymentService.java:63)
>>
>>         at
>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
>> pl
>> oymentService.java:622)
>>
>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>
>>         at java.util.TimerThread.run(Timer.java:462)
>>
>> Caused by: javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
>> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed name
>>
>> space bindings may not be empty.
>>
>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>
>>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>
>>         at
>> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
>> 47
>> 4)
>>
>>         ... 13 more
>>
>> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
>> Prefixed namespace bindings may not be empty.
>>
>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>>
>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>> Source)
>>
>>         ... 16 more
>>
>> ]]></stack-trace>
>>
>>  
>>
>> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
>>
>>  
>>
>> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
>>
>>  
>>
>> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
>>
>>  
>>
>> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
>>
>>  
>>
>> Thanks in advance.
>>
>>  
>>
>> Ben Brown
>>
>> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
>>
>> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
>>
>> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
>>
>> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

RE: Error Parsing WSDL with CXF-BC

Posted by Madesclair Vivian <vm...@sopragroup.com>.
Well my understanding is still limited, but the CXF component only add the SOAP wrapper right? So if the message, witch contains the tag of the method to call use an invalid namespace, it might go wrong. I didn't mean to say that the CXF sends a bad message, but the incoming message in CXF (and therefore the output) might be wrong.

Or maybe I am. And btw what is port decoration?

Regards,
Vivian


-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Envoyé : vendredi 31 juillet 2009 14:09
À : users@servicemix.apache.org
Objet : Re: Error Parsing WSDL with CXF-BC

No Vivian,

HTTP and CXF-BC can use port decoration and so can add new binding and namespace.

Ben, could you provide the target WSDL (the one used by the provider) and the SMX debug log file ? (I will check in the component).

Regards
JB

Madesclair Vivian wrote:
> Hi Ben
> 
> If you wsdl doesnt contain a ns1 namespace, I guess the error comes 
> from the SOAP message that your CXF component is sending to your 
> external service. Do you know the content of this message? (You can 
> activate debug mode of log4j if needed)
> 
> If you still can't solve your problem, can you provide us with the 
> content of the message and the wsdl? (you can attach the file)
> 
> Regards
> Vivian
> 
> -----Message d'origine-----
> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk]
> Envoyé : vendredi 31 juillet 2009 12:01 À : 
> users@servicemix.apache.org Objet : Error Parsing WSDL with CXF-BC
> 
> Hi All
> 
>  
> 
> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
> 
>  
> 
> <loc-message>javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
> Prefixed namespace bindings may not be empty.</loc-message>
> 
> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
> 
>         at
> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
> 50
> 4)
> 
>         at
> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
> java:58)
> 
>         at
> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
> nD
> eployer.java:55)
> 
>         at
> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
> ct
> XBeanDeployer.java:97)
> 
>         at
> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
> ce
> UnitManager.java:88)
> 
>         at
> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
> Un
> itManager.java:69)
> 
>         at
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
> em
> bly(DeploymentService.java:520)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
> eA
> ssembly(AutoDeploymentService.java:349)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
> e(
> AutoDeploymentService.java:255)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
> to
> ry(AutoDeploymentService.java:658)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
> ut
> oDeploymentService.java:63)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
> pl
> oymentService.java:622)
> 
>         at java.util.TimerThread.mainLoop(Timer.java:512)
> 
>         at java.util.TimerThread.run(Timer.java:462)
> 
> Caused by: javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
> Prefixed name
> 
> space bindings may not be empty.
> 
>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> 
>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> 
>         at
> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
> 47
> 4)
> 
>         ... 13 more
> 
> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
> Prefixed namespace bindings may not be empty.
> 
>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> 
>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
> Source)
> 
>         ... 16 more
> 
> ]]></stack-trace>
> 
>  
> 
> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
> 
>  
> 
> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
> 
>  
> 
> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
> 
>  
> 
> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> Ben Brown
> 
> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
> 
> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
> 
> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
> 
> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

Re: Error Parsing WSDL with CXF-BC

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
No Vivian,

HTTP and CXF-BC can use port decoration and so can add new binding and 
namespace.

Ben, could you provide the target WSDL (the one used by the provider) 
and the SMX debug log file ? (I will check in the component).

Regards
JB

Madesclair Vivian wrote:
> Hi Ben
> 
> If you wsdl doesnt contain a ns1 namespace, I guess the error comes from the SOAP message that your CXF component is sending to your external service. Do you know the content of this message? (You can activate debug mode of log4j if needed)
> 
> If you still can't solve your problem, can you provide us with the content of the message and the wsdl? (you can attach the file)
> 
> Regards
> Vivian
> 
> -----Message d'origine-----
> De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk] 
> Envoyé : vendredi 31 juillet 2009 12:01
> À : users@servicemix.apache.org
> Objet : Error Parsing WSDL with CXF-BC
> 
> Hi All
> 
>  
> 
> I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:
> 
>  
> 
> <loc-message>javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
> Prefixed namespace bindings may not be empty.</loc-message>
> 
> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.
> 
>         at
> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:50
> 4)
> 
>         at
> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
> java:58)
> 
>         at
> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanD
> eployer.java:55)
> 
>         at
> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstract
> XBeanDeployer.java:97)
> 
>         at
> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseService
> UnitManager.java:88)
> 
>         at
> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUn
> itManager.java:69)
> 
>         at
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssem
> bly(DeploymentService.java:520)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceA
> ssembly(AutoDeploymentService.java:349)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(
> AutoDeploymentService.java:255)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirecto
> ry(AutoDeploymentService.java:658)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(Aut
> oDeploymentService.java:63)
> 
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDepl
> oymentService.java:622)
> 
>         at java.util.TimerThread.mainLoop(Timer.java:512)
> 
>         at java.util.TimerThread.run(Timer.java:462)
> 
> Caused by: javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
> org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
> Prefixed name
> 
> space bindings may not be empty.
> 
>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> 
>         at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> 
>         at
> org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:47
> 4)
> 
>         ... 13 more
> 
> Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
> Prefixed namespace bindings may not be empty.
> 
>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> 
>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
> Source)
> 
>         ... 16 more
> 
> ]]></stack-trace> 
> 
>  
> 
> I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.
> 
>  
> 
> The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?
> 
>  
> 
> In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.
> 
>  
> 
> Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> Ben Brown
> 
> This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 
> 
> Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.
> 
> Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.
> 
> WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.

RE: Error Parsing WSDL with CXF-BC

Posted by Madesclair Vivian <vm...@sopragroup.com>.
Hi Ben

If you wsdl doesnt contain a ns1 namespace, I guess the error comes from the SOAP message that your CXF component is sending to your external service. Do you know the content of this message? (You can activate debug mode of log4j if needed)

If you still can't solve your problem, can you provide us with the content of the message and the wsdl? (you can attach the file)

Regards
Vivian

-----Message d'origine-----
De : Brown, Ben [mailto:ben.brown@bluefingroup.co.uk] 
Envoyé : vendredi 31 juillet 2009 12:01
À : users@servicemix.apache.org
Objet : Error Parsing WSDL with CXF-BC

Hi All

 

I am attempting to connect to an external web service using a CXF-BC provider.  On deployment of my service unit I am getting the following exception thrown:

 

<loc-message>javax.wsdl.WSDLException: WSDLException:
faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed namespace bindings may not be empty.</loc-message>

<stack-trace><![CDATA[javax.jbi.management.DeploymentException:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed namespace bindings may not be empty.

        at
org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:50
4)

        at
org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
java:58)

        at
org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanD
eployer.java:55)

        at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstract
XBeanDeployer.java:97)

        at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseService
UnitManager.java:88)

        at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUn
itManager.java:69)

        at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssem
bly(DeploymentService.java:520)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceA
ssembly(AutoDeploymentService.java:349)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(
AutoDeploymentService.java:255)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirecto
ry(AutoDeploymentService.java:658)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(Aut
oDeploymentService.java:63)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDepl
oymentService.java:622)

        at java.util.TimerThread.mainLoop(Timer.java:512)

        at java.util.TimerThread.run(Timer.java:462)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed name

space bindings may not be empty.

        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)

        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)

        at
org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:47
4)

        ... 13 more

Caused by: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed namespace bindings may not be empty.

        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)

        ... 16 more

]]></stack-trace> 

 

I have found a few messages on the mailing list that have similar errors, however none seem to have any solutions - apologies if this is not the case I have tried to search for an answer.

 

The WSDL that I am reading does not contain a namespace called ns1, so first question - is this an exception to do with parsing the external WSDL or something to do with an internally generated WSDL?

 

In either case, does anyone have any clue as to how this can be solve, or the 'usual' causes for something like this.  I will probably be unable to post a link to the WSDL easily, however I can try to obfuscate out all identifying information if this would be useful to people.

 

Incidentally, originally the WSDL contained a target namespace of http://tempuri.org <http://tempuri.org/>  - but I had this changed as this appeared to cause errors where the target namespace did not match the actual namespace for the service.  At this stage the SA would deploy correctly with an error message, but no messages could be delivered as it had obviously not parsed the WSDL correctly.

 

Thanks in advance.

 

Ben Brown

This email and any files or information it contains are confidential and may be privileged.  It is for the intended addressee(s) only.  The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email.  Please notify the sender immediately and delete this message from your system. 

Please note that any opinions presented in this email are solely those of the author (or those of a third party whose statement is forwarded) and do not necessarily represent those of any company within the Bluefin Group Limited group of companies.

Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses.  The Bluefin Group Limited group of companies accepts no liability for any damage caused by any virus transmitted by this email.