axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred Preston (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Commented: (AXISCPP-610) No parts in WSDL crashing the wsdlws generator
Date Fri, 03 Mar 2006 14:38:41 GMT
    [ http://issues.apache.org/jira/browse/AXISCPP-610?page=comments#action_12368718 ] 

Fred Preston commented on AXISCPP-610:
--------------------------------------

I have a fix for this problem:-

File:    cpp/literal/ClientStubWriter.java
Comment: Add the if statement so that it will not try to output an empty part.

[526]	//TODO check which version is it really.
[527]	
[528]	if( minfo.getInputMessage() != null)
[529]	{
[530]		writer.write ("\tm_pCall->setOperation(\""
[531]			      + minfo.getInputMessage ().getLocalPart ()
[532]			      + "\", \""
[533]			      + minfo.getInputMessage ().getNamespaceURI ()
[534]			      + "\");\n");
[535]	}

File:    WSDL2Ws.java
Comment: Replace the addDocumentStyleInputMessageToMethodInfo with the following:-

    private void addDocumentStyleInputMessageToMethodInfo(
        Operation op,
        MethodInfo minfo)
        throws WrapperFault
    {
        Element element;
        QName qname;
        ParameterInfo pinfo;
        Type type;
        Iterator paramlist;

        paramlist = op.getInput().getMessage().getParts().values().iterator();
        
        Part part = null;
        
        if( paramlist.hasNext())
        {
            part = (Part) paramlist.next();
        }
        
        
        if( part != null)
        {
            QName minfoqname;
            element = symbolTable.getElement(part.getElementName());
            
	        if (element == null)
	        {
	            // the part reference a type.
	            qname = symbolTable.getType(part.getTypeName()).getQName();
	            minfoqname = symbolTable.getType(part.getTypeName()).getQName();
	        }
	        else
	        {
	            qname = element.getRefType().getQName();
	            minfoqname = element.getQName();
	        }
	        minfo.setInputMessage(minfoqname);
	
	        if (qname != null)
	        {
	            type = this.typeMap.getType(qname);
	            boolean wrapped = wsdlWrappingStyle;
	
	            if (type == null)
	            {
	                throw new WrapperFault(
	                    "unregistered type " + qname + " referred");
	            }
	
	            if (wrapped)
	            {
	                //get inner attributes and elements and add them as parameters
	                addInputElementsToMethodInfo(minfo, type);
	                addInputAttributesToMethodInfo(minfo, type);
	            }
	            else
	            { // for non-wrapped style wsdl's
	                String elementName = (String) element.getQName().getLocalPart();
	                pinfo = new ParameterInfo(type, elementName);
	                pinfo.setElementName(type.getName());
	                if (type.getName().equals(CUtils.anyTypeQname))
	                {
	                    pinfo.setAnyType(true);
	                }
	                minfo.addInputParameter(pinfo);
	            }
	        }
        }
    }

But, it has not been implemented.

> No parts in WSDL crashing the wsdlws generator
> ----------------------------------------------
>
>          Key: AXISCPP-610
>          URL: http://issues.apache.org/jira/browse/AXISCPP-610
>      Project: Axis-C++
>         Type: Bug
>   Components: WSDL processing - Doc
>     Versions: 1.5 Beta
>  Environment: Win32
>     Reporter: Carsten Blecken
>     Priority: Minor

>
> The attached WSDL gives an error
>      [java] WARNING: Unable to find required classes (javax.activation.DataHandl
> er and javax.mail.internet.MimeMultipart). Attachment support is disabled.
>      [java] java.util.NoSuchElementException
>      [java]     at java.util.HashMap$HashIterator.nextEntry(HashMap.java:785)
>      [java]     at java.util.HashMap$ValueIterator.next(HashMap.java:812)
>      [java]     at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.addDocumentStyleInputMes
> sageToMethodInfo(Unknown Source)
>      [java]     at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.setMethodInfo(Unknown So
> urce)
>      [java] Code generation failed. Please see errors above.
>      [java]     at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.getServiceInfo(Unknown S
> ource)
>      [java]     at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.generateWrappers(Unknown
>  Source)
>      [java]     at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.main(Unknown Source)
> due to the lack of a part in the input message.
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:somecompany/platform/v1_0" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:somecompany/platform/v1_0"
xmlns:intf="urn:somecompany/platform/v1_0" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>  <wsdl:types>
>   <schema targetNamespace="urn:somecompany/platform/v1_0" xmlns="http://www.w3.org/2001/XMLSchema">
>   
>    <xsd:complexType name="UserTokenType">     
> 	<xsd:sequence>
> 		   <element name="Token" type="xsd:string"/>
> 	</xsd:sequence>
>    </xsd:complexType>
>    <element name="UserTokenReturn" type="impl:UserTokenType"/>
>   
>   </schema>
>   
>  </wsdl:types>
>    <wsdl:message name="getUserTokenRequest">
>    </wsdl:message>
>    <wsdl:message name="getUserTokenResponse">
>       <wsdl:part element="impl:UserTokenReturn" name="getUserTokenReturn"/>
>    </wsdl:message>
>    <wsdl:portType name="MyAuthentication">
>       <wsdl:operation name="getUserToken">
>          <wsdl:input message="impl:getUserTokenRequest" name="getUserTokenRequest"/>
>          <wsdl:output message="impl:getUserTokenResponse" name="getUserTokenResponse"/>
>       </wsdl:operation>
>    </wsdl:portType>
>    <wsdl:binding name="MyAuthenticationSoapBinding" type="impl:MyAuthentication">
>       <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>       <wsdl:operation name="getUserToken">
>          <wsdlsoap:operation soapAction=""/>
>          <wsdl:input name="getUserTokenRequest">
>             <wsdlsoap:body namespace="urn:somecompany/platform/v1_0" use="literal"/>
>          </wsdl:input>
>          <wsdl:output name="getUserTokenResponse">
>             <wsdlsoap:body namespace="urn:somecompany/platform/v1_0" use="literal"/>
>          </wsdl:output>
>       </wsdl:operation>
>    </wsdl:binding>
>    <wsdl:service name="MyAuthenticationService">
>       <wsdl:port binding="impl:MyAuthenticationSoapBinding" name="MyAuthentication">
>          <wsdlsoap:address location="http://localhost:8888/myapp/services/MyAuthentication?wsdl"/>
>       </wsdl:port>
>    </wsdl:service>
> </wsdl:definitions>
> Seems like in WSDL2Ws.addDocumentStyleInputMessageToMethodInfo a check for
> existence (hasNext()) has been missed.
>         paramlist = op.getInput().getMessage().getParts().values().iterator();
>         Part part = (Part) paramlist.next();    <-- this can be null
>         QName minfoqname;
>         element = symbolTable.getElement(part.getElementName());

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message