2010-04-29 3 views
2

내가이 오류를 얻을 :없음 엔드 포인트 매핑 SpringWS를 사용하기위한 ... 발견, JAXB Marshaller의

<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"> 
    <description>An endpoint mapping strategy that looks for @Endpoint and @PayloadRoot annotations.</description> 
</bean> 
<bean class="org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter"> 
    <description>Enables the MessageDispatchServlet to invoke methods requiring OXM marshalling.</description> 
    <constructor-arg ref="marshaller"/> 
</bean> 

<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> 
    <property name="contextPaths"> 
    <list> 
     <value>org.company.xml.persons</value> 
     <value>org.company.xml.person_allextensions</value> 
     <value>generated</value> 
    </list> 
    </property> 
</bean> 


<bean id="persons" class="com.easy95.springws.wsdl.wsdl11.MultiPrefixWSDL11Definition"> 
    <property name="schemaCollection" ref="schemaCollection"/>            
    <property name="portTypeName" value="persons"/>         
    <property name="locationUri" value="/ws/personnelService/"/>        
    <property name="targetNamespace" value="http://mycompany/coolservice/specs/definitions"/>  
</bean> 

<bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">     
    <property name="xsds"> 
    <list> 
     <value>/DataContract/Person-AllExtensions.xsd</value> 
     <value>/DataContract/Person.xsd</value> 
    </list> 
    </property> 
    <property name="inline" value="true"/>  
</bean> 
: 대한 찾을 수 없습니다 엔드 포인트 매핑을 [SaajSoapMessage { http://mycompany/coolservice/specs} ChangePerson]

다음은 내 WS 설정 파일입니다

내가 다음 파일이 있습니다

public interface MarshallingPersonService { 

public final static String NAMESPACE = "http://mycompany/coolservice/specs"; 
public final static String CHANGE_PERSON = "ChangePerson"; 

public RespondPersonType changePerson(ChangePersonType request); 
} 

저는 WebServices를 처음 접했을뿐 아니라 주석을 사용하기도 쉽지 않습니다. springws에서 jaxb marshaller 설정에 대한 자습서를 수행 중입니다. 주석 대신 xml 매핑을 사용하고 싶지만, 지금은 오류 메시지가 나타납니다.

편집 : ChangePersonType

@XmlAccessorType(XmlAccessType.FIELD) 
@XmlType(name = "ChangePersonType", propOrder = { 
"applicationArea", 
"dataArea" 
}) 
public class ChangePersonType { 

@XmlElement(name = "ApplicationArea", namespace = "http://mycompany/coolservice/specs", required = true) 
protected TransApplicationAreaType applicationArea; 
@XmlElement(name = "DataArea", namespace = "http://mycompany/coolservice/specs", required = true) 
protected DataArea dataArea; 
@XmlAttribute(required = true) 
@XmlJavaTypeAdapter(NormalizedStringAdapter.class) 
protected String releaseID; 
@XmlAttribute 
@XmlJavaTypeAdapter(NormalizedStringAdapter.class) 
protected String versionID; 

--The 나머지는 getter 및 setter입니다.

+0

나는 또한 어둠 속에서 촬영과 일정 네임 스페이스를 설정합니다. 이 주석이 ChangePerson을 선택하는 방법과 내가 잘못하고있는 것이 어떤 아이디어/제안입니까? – Saky

+0

'ChangePersonType'을위한 소스를 추가 할 수 있습니까? 아니면 최소한 그 몇 줄까지 추가 할 수 있습니까? – skaffman

+0

완료되면, jaxb xjc 컴파일러에 의해 생성됩니다. – Saky

답변

1

해결했습니다. 엔드 포인트 클래스 및 리턴 변수의 매개 변수는 JAXBElement처럼 JAXBElement에 래핑되어야합니다. "{: // mycompany/coolservice/사양 HTTP} ChangePerson"하지만 didnt 한 일

이유는

The classes generated by JAXB2 from your schema come in two flavors: those that have a @XmlRootElement annotation, which can be used directly as either parameter or response, and those who haven't. Those classes which haven't got this annotation need to be wrapped in a JAXBElement.

Besides the generated classes from your schema, JAXB2 also generates an ObjectFactory class, which clarifies the use of JAXBElement. There are some factory methods is there, which illustrate how you can use the various schema types.

Arjen Poutsma h ttp://forum.springsource.org/showthread.php?t=49817

관련 문제