2017-05-23 6 views
0

Oracle Sales Cloud Webサービスを使用しようとしています。 wsimportを使用してWebサービスが消費され、結果のjarファイルがアプリケーションに追加されました。インポートに使用JavaからOracle Sales Cloud Webサービスにアクセスする

wsimportのコマンド: wsimport.exe -keep -clientJar PartnerService.jar https://cbdy-test.crm.us2.oraclecloud.com/partnerCenterCorePublicModel/PartnerService?WSDL

ジャーを警告して構築します。合計8つのOracle Webサービスで同じプロセスが実行されました。 8.

のJavaのうちの2ウェブserviesのためにスローされwsimportの生成ジャーエラーの経由してWebサービスにアクセスしようとし

Howeeverはスニペット:

14.PartnerService_Service partnerService_Service = new PartnerService_Service(new URL("https://cbdy-test.crm.us2.oraclecloud.com/partnerCenterCorePublicModel/PartnerService?WSDL")); 
    15.PartnerService partnerService = partnerService_Service.getPartnerServiceSoapHttpPort(); 
    16.Map<String, Object> requestCredentails = ((BindingProvider) partnerService).getRequestContext(); 
    17.requestCredentails.put(BindingProvider.USERNAME_PROPERTY, "#######"); 
    18.requestCredentails.put(BindingProvider.PASSWORD_PROPERTY, "#######"); 

例外:

Exception in thread "main" com.sun.xml.internal.ws.spi.db.DatabindingException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 17 counts of IllegalAnnotationExceptions 
There's no ObjectFactory with an @XmlElementDecl for the element {http://xmlns.oracle.com/apps/cdm/foundation/parties/contactPointService/}OrigSystemReference. 
this problem is related to the following location: 
    at protected javax.xml.bind.JAXBElement com.oracle.xmlns.apps.cdm.foundation.parties.contactpointservice.Edi.origSystemReference 
    at com.oracle.xmlns.apps.cdm.foundation.parties.contactpointservice.Edi 
    at protected java.util.List com.oracle.xmlns.apps.cdm.foundation.parties.organizationservice.OrganizationParty.edi 
    at com.oracle.xmlns.apps.cdm.foundation.parties.organizationservice.OrganizationParty 
    at public javax.xml.bind.JAXBElement com.oracle.xmlns.apps.cdm.foundation.parties.organizationservice.ObjectFactory.createOrganizationPartySourceSystemReferenceValue(java.lang.String) 
    at com.oracle.xmlns.apps.cdm.foundation.parties.organizationservice.ObjectFactory 
    .... 
    at javax.xml.ws.Service.getPort(Unknown Source) 
    at com.oracle.xmlns.apps.partnermgmt.partnercenter.PartnerService_Service.getPartnerServiceSoapHttpPort(PartnerService_Service.java:68) 
    at com.oscservice.Dummy.main(Dummy.java:15) 

私はこの問題についてhereと他のいくつかのstackoverflow投稿を参照しましたが、問題のあるWebサービスでこの問題を解決できません。

解決に役立つポインタがあれば助かります。

答えて

0

質問で問題を過ぎることができました。 Webサービスコールを呼び出すコードブロックが、新しいプロジェクトと同じプロジェクト内の別のクラスで動作していました。 問題は、プロジェクトの構築方法から生じたようです。

私は古いコードでステップごとに新しいプロジェクトを作成しましたが、エラーは発生しませんでした。

関連する問題