0

私はこれが初めてで、PHPの石鹸の使用方法を理解しようとしてフォーラムを調べています。

そろそろ毛を抜くぞー!

このヘッダーを生成する方法を見つけようとして何兆年も費やしています。

<AutenticationToken>
      <Username>admin</Username>
      <Password>123456</Password>
   </AutenticationToken>

これを使用して終了しました:

$sh_param = "<AutenticationToken><Username>admin</Username><Password>123456</Password></AutenticationToken>";
$auth = new SoapVar($sh_param, XSD_ANYXML, null, null, null);
$headers = new SoapHeader($wdsl, 'AuthenticationToken', $auth);

このように「ns」を生成し続けます->このメソッドを使用すると。

<ns2:AuthenticationToken>
  <item>
   <key>Username</key>
   <value>admin</value>
  </item>
  <item>
   <key>Password</key>
   <value>123456</value>
  </item>
</ns2:AuthenticationToken>


$sh_param = array( 
                    'Username'    =>    'admin', 
                    'Password'    =>    '123456'); 
 $headers = new SoapHeader($wsdl, 'AuthenticationToken', $sh_param); 

<soap:Envelopeからに変更する必要があります<SOAP-ENV:Envelope 。ヘルプ!


camel ルートの検証でエラーが発生しました

私はキャメルを使用してxmlを検証していますが、ルートでは次のことを行っています:

<route>
    <from uri="file:{{file.inbox}}?preMove=inprogress&amp;move=../.done"/>
    <doTry>
        <to uri="validator:classpath:idocOrderStatus.xsd"/>
        <to uri="file:{{file.outbox.valid}}"/>
        <doCatch>
            <exception>org.apache.camel.ValidationException</exception>
            <to uri="file:{{file.outbox.invalid}}"/>
        </doCatch>
    </doTry>
</route>

次のエラーが表示されます。

    Exception in thread "SpringOsgiExtenderThread-10" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route7 at: >>> DoT
ry[[To[validator:classpath:idocOrderStatus.xsd], To[file:outbox/valid], DoCatch[ null -> [To[file:{{file.outbox.invalid}}]]]]] <<< in route: Route[[From[file:{{file.inbox}}?preMove=inprogres
s&move=../.... because of org.apache.camel.ValidationException
        at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1157)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:110)
        at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
        at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:
132)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route7 at: >>> DoTry[[To[validator:classpath:idocOrderStatus.xsd], To[file:outbox/valid], DoCatch[ null -> [T
o[file:{{file.outbox.invalid}}]]]]] <<< in route: Route[[From[file:{{file.inbox}}?preMove=inprogress&move=../.... because of org.apache.camel.ValidationException
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:820)
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
        at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:685)
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1683)
        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1468)
        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1360)
        at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:169)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1328)
        at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:213)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:108)
        ... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.camel.ValidationException
        at org.apache.camel.impl.DefaultClassResolver.resolveMandatoryClass(DefaultClassResolver.java:52)
        at org.apache.camel.model.CatchDefinition.createExceptionClasses(CatchDefinition.java:254)
        at org.apache.camel.model.CatchDefinition.createProcessor(CatchDefinition.java:91)
        at org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:90)
        at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:444)
        at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:817)
        ... 21 more

このエラーが発生する理由がわかりません。このクラスをラクダのコンテキストにインポートする方法はありますか? どうすればいいですか?

4

1 に答える 1

1

クラス SOAPStruct

{

function __construct($user, $pass) 
{
    $this->Username = $user;
    $this->Password = $pass;
}

}

//set username and password
$auth = new SOAPStruct("admin","123456");

//soap header object
$header = new SoapHeader("http://gateway.asiagategroup.com/","AutenticationToken",$auth,false); 
$client->__setSoapHeaders($header);

これで問題が解決することを願っています

于 2012-06-20T13:56:31.687 に答える